Recreating Conway’s Game of Life using React
The Game of Life is a little sandbox game that was designed in the 70s. The game is not particularly spectacular, but it is nonetheless noteworthy because it shows how complex patterns can emerge from just a handful of very simple rules. There’s another article on this website that explains these rules and shows what kind of cool stuff you can create with them. This page is about my open-source implementation of the Game.
The game is built using a handful of tools:
-
TypeScript is a superset of JavaScript that adds static typing to JavaScript. This makes it much easier to produce and document code that is both correct and concise.
-
The interface is built using React, a popular JavaScript library for building user interfaces in a declarative way.
-
Jest for unit and functional tests, so I don’t have to verify the correctness of my game manually (as if I’m some kind of caveman).
My reimplementation of the Game consists of two parts: the game itself and the user interface (UI). Neither is particularly interesting on its own, but the clear divide between the game and its UI makes it a lot easier to completely overhaul the UI without having to make any modifications to the code of the game.
Playable versions of the Game can be found on GitHub Pages and in this “Flat Earth” article.