In this repository, we include the code necessary to run the game of life specified in the Embedded & Real Time Systems course taught at the MS in Automatic Control and Robotics @ UPC.
- Any live cell with fewer than two live neighbours dies, as if caused by under-population.
- Any live cell with two or three live neighbours lives on to the next generation
- Any live cell with more than three live neighbours dies, as if by over-population.
- Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
Series of patterns
Because of the rules specified previously, different structures get generated. They are categorized into three main groups depending if they are static(still lifes
), if they don't move but change pattern (oscillators
), and the last ones are those that move (spaceships
).
Start by git cloning this repository locally:
mkdir -p ~/git && cd ~/git
git clone https://github.com/JaumeAlbardaner/gameOfLife.git
Compile the C code:
cd ~/git/gameOfLife && make
Run it 🎉
cd ~/git/gameOfLife && ./main
Once you run it, you may select the dimensions of the world as well as what structure you want to simulate from:
Name | Command # | Preview |
---|---|---|
The R-Pentomino | 1 | |
Diehard | 2 | |
Acorn | 3 | |
Random | else | - |
-
The only issue that has been found is that requesting a large grid size may result in the Game of Life not appearing in its entirety on the screen.
Fix Set a smaller size for the board, or try rerunning the game (maybe it was just a bad unlucky initialization).