It's minimal version I can come up with for now. Currently, starting positions of cells are hard coded. But, the game is working correctly.
I wish to add a feature where I can toggle cell by clicking. I see why Conway's game of life become an example project for WASM with Rust. It's difficult to do it efficiently. For example, to change state of the grid, I created a whole new array just to store next state. It can be done more efficiently by storing change instead.
The code is not really consistent for now. But, I will left it be because I need to reference it when I improve the code in another project.
Top comments (0)