DEV Community

Pontakorn Paesaeng
Pontakorn Paesaeng

Posted on

I build a minimal Conway's Game of Life with JavaScript

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)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post