The Game of Life, created by John Conway, is a well-known cellular automaton. It features a grid of cells where each cell can either be alive or dead. The evolution of each cell's state over time is determined by straightforward rules:
A live cell with two or three live neighbors continues to live. A dead cell with exactly three live neighbors becomes alive. All other live cells die, and all other dead cells stay dead.
Despite its simplicity, the game can produce intricate and captivating patterns and behaviors, including a fully functional computer or even another instance of the Game of Life.
Here is a Scala 3 implementation of Conway’s Game of Life. This project was developed mainly to get familiar with Scala 3, with the goal of quickly producing a polished and releasable product. You can access the completed project here.
DISCLAIMER: The user-interface may not work equally well on all devices and screen sizes. Feel free to submit a PR if you have a fix :)
This implementation of the Game of Life is built using the following technologies:
- Download and install Scala 3
- Download and install a compatible IDE such as IntelliJ IDEA or a text editor like Visual Studio Code (requires Metals extension)
- Download or clone this repository
- Open it in your IDE or text editor of choice
- Open a terminal and enter
npm install
thennpm run dev
(open the localhost link) - Open another terminal and enter
sbt
followed by~fastOptJS
Play around with the Game of Life!
- To produce a production build, use
npm run build
(output will be in thedist
folder)
Distributed under the MIT License. See LICENSE.md for more information.
Daniel Larsen (iyyel) - iyyel.io - [email protected]
Ivan Yurchenko - https://ivanyu.me - github