Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Improvements #7

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1d97b59
:arrow_up: Updated packages
sondregj Oct 27, 2019
844e28f
:wrench: Updated TSLint config
sondregj Oct 30, 2019
ade7b59
:arrow_up: Updated packages
sondregj Oct 30, 2019
7a6dc93
:boom: Initial code for pattern support
sondregj Oct 30, 2019
1b4b74e
:memo: Added headers for usage examples
sondregj Oct 30, 2019
84b28a2
:memo: Re-ordered examples
sondregj Oct 30, 2019
9a75f41
:white_check_mark: Improved test structure
sondregj Nov 3, 2019
f22fedc
:hammer: Custom rule function to test advance in isolation
sondregj Nov 3, 2019
f7b10a5
:boom: Separated neighbor count logic
sondregj Nov 3, 2019
3f54c55
:pencil: Renamed file
sondregj Nov 3, 2019
17dac46
:wrench: Updated TSLint rules
sondregj Nov 3, 2019
1b8b8cc
:white_check_mark: Updated test
sondregj Nov 3, 2019
4a14d64
:arrow_up: Updated packages
sondregj Nov 6, 2019
cad072c
:sparkles: applyPattern function
sondregj Nov 6, 2019
da41267
:construction: Improved rule function
sondregj Nov 6, 2019
2eda6c1
:art: Added type to advance function
sondregj Nov 6, 2019
d8e6144
:art: Improved types file
sondregj Nov 6, 2019
4c43bc5
:sparkles: Finished applyPattern function and added test
sondregj Apr 18, 2020
1f315e8
:fire: Remove Travis builds
sondregj Apr 18, 2020
d55d947
Merge branch 'development' into feature/patterns
sondregj Apr 18, 2020
1c1c954
👾 Pattern support - Merge pull request #5 from sondregj/feature/patterns
sondregj Apr 18, 2020
adf046a
:wrench: Switch from TSLint to ESLint
sondregj Apr 18, 2020
c3dc752
:memo: Update README
sondregj Apr 20, 2020
a203907
:arrow_up: Update packages
sondregj Jun 10, 2020
366cd42
:construction_worker: Remove Node 8 CI
sondregj Jun 10, 2020
b11a926
:wrench: Update configuration files
sondregj Jan 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}
27 changes: 13 additions & 14 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ dist

# FuseBox cache
.fusebox/

# Misc.
.DS_Store
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,21 @@ const world = {
const day1 = advance(world)
```

You can also define custom rule functions.
### Initializing a board

A convenience function for initializing boards is included.

```javascript
import { initializeBoard, advance } from '@sondregj/conway'

const genesis: Board = initializeBoard(64, 64, { random: true })

const day1 = advance(genesis)
```

### Custom rule functions

You can define custom rule functions.

```javascript
import { advance } from '@sondregj/conway'
Expand All @@ -70,15 +84,7 @@ const rules = (board, cell, x, y) => !cell.alive
const day1 = advance(world, rules)
```

A convenience function for initializing boards is also included.

```javascript
import { initializeBoard, advance } from '@sondregj/conway'

const genesis: Board = initializeBoard(64, 64, { random: true })

const day1 = advance(genesis)
```
### TypeScript types

The following TypeScript types are included.

Expand All @@ -103,4 +109,4 @@ const rules: RuleFunction = (board: Board, cell: Cell, x: number, y: number): bo

## License

MIT © 2019 Sondre Gjellestad
MIT © 2020 Sondre Gjellestad
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
globals: {
'ts-jest': {
tsConfig: 'tsconfig.json'
tsconfig: 'tsconfig.json'
}
},
transform: {
Expand Down
Loading