Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/semibran/life
:gear: conway's game of life
https://github.com/semibran/life
cellular-automata game game-of-life physics simulation
Last synced: about 1 month ago
JSON representation
:gear: conway's game of life
- Host: GitHub
- URL: https://github.com/semibran/life
- Owner: semibran
- License: mit
- Created: 2017-01-09T22:48:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-10T22:50:53.000Z (almost 7 years ago)
- Last Synced: 2024-04-27T07:33:48.946Z (9 months ago)
- Topics: cellular-automata, game, game-of-life, physics, simulation
- Language: JavaScript
- Homepage: https://semibran.github.io/life/
- Size: 85.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# life
![conway's game of life](life.png)
> [View the demo][demo]Any [cellular automaton] with rules [similar to][life-like] [Conway's Game of Life] can be modeled using a data structure similar to the following:
```js
let world = {
time: 0
rule: { birth: [ 3 ], survival: [ 2, 3 ] }
size: [ 256, 256 ]
data: new Uint8ClampedArray(256 * 256)
.fill()
.map(_ => Math.random() < 0.25)
}
```
The update function found in `lib/update.js` efficiently advances the given `world` by a single unit of time. Altering the rule, size, and seed of the above structure would enable you to simulate any cellular automaton with Life-like mechanics.## license
[MIT][MIT license] © [Brandon Semilla][github][demo]: https://semibran.github.io/life/
[life-like]: https://en.wikipedia.org/wiki/Life-like_cellular_automaton
[cellular automaton]: https://en.wikipedia.org/wiki/Cellular_automaton
[conway's game of life]: https://en.wikipedia.org/wiki/Conway's_Game_of_Life
[MIT license]: https://opensource.org/licenses/MIT
[github]: https://github.com/semibran