Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tasxatzial/game-of-life
https://github.com/tasxatzial/game-of-life
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tasxatzial/game-of-life
- Owner: tasxatzial
- License: mit
- Created: 2020-10-05T21:42:59.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T09:02:04.000Z (over 1 year ago)
- Last Synced: 2024-06-23T12:26:28.299Z (5 months ago)
- Language: C
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Game of Life
The [Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) by John Horton Conway.
Given an initial state of a cellular automaton, the program calculates its state after 50 iterations.
## Implementation
Two versions are provided, one that uses only local variables and one that uses both local and global variables. Both versions behave the same.
Cells are represented by a fixed grid, and any cells located outside the grid are considered dead. The dimensions of the grid are determined by the first line of the input file.
## Compile
* Build the local variables version
```bash
make game_local
```* Build the global variables version
```bash
make game_global
```## Typical usage
Read initial state from input_file and write the final state to out_file:
```bash
./game_local input_file out_file
```## Tests
See [tests](tests). Two input .txt files are provided along with their corresponding .out files after 50 iterations.
## Profiling
'game_local' and 'game_global' been tested for memory leaks with [valgrind](https://valgrind.org/) and [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer).