Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colmiik/game_of_life
https://github.com/colmiik/game_of_life
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/colmiik/game_of_life
- Owner: ColmiiK
- Created: 2024-05-01T11:44:39.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-05-01T11:44:40.000Z (10 months ago)
- Last Synced: 2024-11-08T19:14:07.768Z (3 months ago)
- Language: C
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Conway's Game of Life
This is a very simple implementation of the cellular automaton devised by John Conway in 1970. The rules are simple:
- Any live cell with fewer than two live neighbours dies, as if by underpopulation.
- 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 overpopulation.
- Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.To execute the program, clone the repository and navigate to it, then run the following command:
```bash
make && ./game_of_life
```
This will run the simulation in a default sized grid (100x50). If you want to run it in a different sized grid, you can pass the width and height as arguments to the program:
```bash
./game_of_life 50 50
```
Finally, you can also pass a pattern file in a `.rle` format inside the `patterns` directory to the program. For example:
```bash
./game_of_life 50 50 patterns/glider.rle
```
The program will then run the simulation with the specified pattern.## Note: currently, the patterns don't fully work.
## Also, the borders of the grid don't wrap around, meaning that cells on the edge consider "cells" outside of the grid as dead cells.