Files
004_comission/chris20202020/_ref/game-of-life-js/README.md
louiscklaw d8e1289123 update,
2025-01-31 19:30:10 +08:00

10 lines
546 B
Markdown

A JavaScript implementation of [Conway's Game of Life](http://web.stanford.edu/%7Ecdebs/GameOfLife/).
- represents the board as 2D array of cells
- creates a second representation of board as 2D array of number of live neighbors
- uses map, filter, and reduce for calculation/iteration
`index.html` displays a canvas version of the program, with play/pause and reload buttons. (Play/pause can be triggered with the `Space` or `Enter` keys. Reloading can be triggered with the `r` key.)
Also, can run on the terminal or in the browser console.