New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

game-of-life-logic

Logic for Conway's Game of Life. It uses a looping-matrix so that entities loop from edge to edge.

1.0.0
latest
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created

game-of-life-logic

Build Status npm npm Downloads Coverage Status

Logic for Conway's Game of Life. It uses a looping-matrix so that entities loop from edge to edge.

Install

$ npm install --save game-of-life-logic

Usage

var GameOfLife = require('game-of-life-logic');
var gameOfLife = new GameOfLife(5, 5)
gameOfLife.copyMatrixAt(1, 1, [
[0, 0, 0],
[1, 1, 1],
[0, 0, 0]
])
gameOfLife.matrix
/* => [
		[0, 0, 0, 0, 0],
		[0, 0, 0, 0, 0],
		[0, 1, 1, 1, 0],
		[0, 0, 0, 0, 0],
		[0, 0, 0, 0, 0]
      ]
*/
gameOfLife.tick()
gameOfLife.matrix
/* => [
		[0, 0, 0, 0, 0],
		[0, 0, 1, 0, 0],
		[0, 0, 1, 0, 0],
		[0, 0, 1, 0, 0],
		[0, 0, 0, 0, 0]
      ]
*/

API

Coming soon...

License

MIT © David da Silva

FAQs

Package last updated on 29 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts