Game of Life (What the hell is this ?)
You can view a demo of this app here - http://www.kartikanand.com/game-of-life/
This app uses webpack to bundle everything into a single js file for scripts and styles. You can find the generated js file in the
The source for these scripts and styles can be found in the aptly named
To build use the following command:
You can then use local server to serve the
index.html file which correctly uses the
dist path. One way for doing it is:
python3 -m "http.server"
You'll find two buttons on the page. The
Start button will the start the simulation with a random distribution of cells, while the
Stop button will only pause it, not reset it.
To reset simply reload the page.
How it works
The app relies on React references to latch onto the html canvas element. The rest of it is just timers to update the next state of each cell. You can find the meat of the code at
Please feel free to send pull requests or open a bug or feature request using the Issues tab.
- Add a pause button and make
Stopdo what it is supposed to do
- Add a button to make random distributions
- Allow users to create their own distributions using mouse clicks
- Allow users to change the speed of simulation