conway_game_of_life
v1.0.1
Published
Conway's Game of Life
Downloads
3
Readme
TDD - Game of life
- [] install dependencies (npm i mocha chai @babel/core @babel/preset-env @babel/register)
- [] note: mocha chai @babel/core(for better compatibility to other browsers) @babel/preset-env(for transpiling to an older version of javascript) @babel/register(for Node.js/React.js) []Setup babel []note: add babelrc with {"presets": ["@babel/preset-env"]} in it
- [] setup test directory (just add a new folder)
- [] add test script
- [] note: in package.json, fix "test": "mocha --require @babel/register"
CellState [] has the ALIVE state [] has the DEAD state
Cell [] should be initialized with a cell state [] should throw an error without being initialized with a cell state [] should die if it has less than 2 live neighbours [] should live if it has 2-3 live neighbours [] should die if it has more than 3 live neighbours [] should come alive from a DEAD state if it has more than 3 live neighbours [] should stay DEAD if it has fewer than 2 live neighbours
Game [] Should be initialized with a given state [] Should retrieve a cell at a given row and column [] Should get num of ALIVE neighbours in a given cell [] Should create the next state of the game
*Optional []publish to npm []note: git init gitignore node