Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blaze33/way-of-life
Conway's game of life implemented in JavaScript & WebAssembly, rendered to canvas.
https://github.com/blaze33/way-of-life
canvas-element conway-game game-of-life javascript webassembly
Last synced: 3 months ago
JSON representation
Conway's game of life implemented in JavaScript & WebAssembly, rendered to canvas.
- Host: GitHub
- URL: https://github.com/blaze33/way-of-life
- Owner: blaze33
- License: mit
- Created: 2017-05-14T20:30:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T00:50:56.000Z (almost 2 years ago)
- Last Synced: 2024-04-23T23:38:11.750Z (7 months ago)
- Topics: canvas-element, conway-game, game-of-life, javascript, webassembly
- Language: JavaScript
- Homepage: https://blog.openbloc.fr/webassembly-first-steps/
- Size: 2.17 MB
- Stars: 228
- Watchers: 8
- Forks: 14
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# The Way of Life
Conway's game of life implemented both in JavaScript and in WebAssembly using a canvas element for rendering.
* [Demo](https://blaze33.github.io/way-of-life/)
* [Demo up to 60FPS, 1 pixel per cell](https://blaze33.github.io/way-of-life/?desiredFPS=60&pixelsPerCell=1)[![npm](https://img.shields.io/npm/v/way-of-life.svg)](https://www.npmjs.com/package/way-of-life)
[![Build Status](https://travis-ci.org/blaze33/way-of-life.svg?branch=master)](https://travis-ci.org/blaze33/way-of-life)## Installation
The npm package only links to the ES6 code so it's only usable as a dependency for now.
```bash
npm install --save-dev way-of-life
```## Usage
```javascript
import {Engine, acorn} from 'way-of-life'// initialize the game with an empty 40x40 matrix
const engine = new Engine(40, 40)
engine.init()// initialize some living cells around the center of the matrix
acorn(engine, 20, 20)// compute the next state of game
engine.computeNextState()
```See the [demo code](https://github.com/blaze33/way-of-life/blob/master/src/js/demo.js) for a more advanced usage.