https://github.com/dawidbieniek/gameoflife
A terminal-based implementation of Conway's Game of Life in ANSI C for QNX. It offers real-time simulation with customizable board sizes, rule modifications, and state persistence. Made for university course
https://github.com/dawidbieniek/gameoflife
ansi-c game-of ncurses qnx simulation
Last synced: 3 months ago
JSON representation
A terminal-based implementation of Conway's Game of Life in ANSI C for QNX. It offers real-time simulation with customizable board sizes, rule modifications, and state persistence. Made for university course
- Host: GitHub
- URL: https://github.com/dawidbieniek/gameoflife
- Owner: dawidbieniek
- Created: 2023-04-14T19:07:11.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-09T18:50:29.000Z (3 months ago)
- Last Synced: 2025-03-09T19:22:58.018Z (3 months ago)
- Topics: ansi-c, game-of, ncurses, qnx, simulation
- Language: C
- Homepage:
- Size: 82 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
A simple terminal-based implementation of Conway's Game of Life running on QNX in real-time.
## About
A terminal-based simulation of Conway's Game of Life. The program is written in ANSI C to run on QNX (real-time operating system) for one of university courses. It supports custom board sizes, rule modifications, and file-based board saving/loading.![Screenshot of application][app-screenshot]
### Built With
[![ANSI C][c-badge]][c-url]
[![NCurses][curses-badge]][curses-url]
[![PThread][pthread-badge]][pthread-url]
## Features
* **Real-Time Simulation:** Program can be run on real-time operating system like QNC.
* **Customizable Board:** Adjust board dimensions and enable board edge wrapping.
* **Rule Customization:** Easily modify cell survival and birth rules to explore alternative versions of the Game of Life.
* **State Persistence:** Save and load board states from files, allowing you to resume simulations.
* **Speed Control:** Fine-tune simulation speed to slow down or accelerate the evolution of cellular patterns.
* **Toggle Wrapping Mode:** Enable or disable board wrapping to alter edge behavior during simulation.
* **Use built-in maps:** In `maps/` directory there already a few example map files that can be loaded into program. Path to board file should start from program's directory (eg. maps/glider).## Getting Started
### Prerequisites
You need the following:
* QCC or GCC compier
- Ncurses library (on Ubuntu/Debian, install with: `sudo apt install libncurses-dev`).
- Pthread library (usually included by default, but if needed, install via your package manager).### Installation
1. Clone the repository:
```
git clone https://github.com/dawidbieniek/GameOfLife.git
```
2. Build the project:
```
make
```
3. Run the program:
```
./gol
```### Configuration
The Makefile supports optional flags:
* **WIDE=1** - each cell will be wider making each cell square
* **REDRAW=1** - board will be redrawn on each update. This can prevent screen tearing-like artifacts from showing> [!note]
> To remove build files (object files), run:
> ```
> make clean
> ```[app-screenshot]: img/app.png
[c-badge]: https://img.shields.io/badge/ANSI_C-A8B9CC?style=for-the-badge&logo=C&logoColor=white
[c-url]: https://en.wikipedia.org/wiki/ANSI_C
[curses-badge]: https://img.shields.io/badge/NCurses-CCCCCC?style=for-the-badge
[curses-url]: https://invisible-island.net/ncurses/
[pthread-badge]: https://img.shields.io/badge/PThead-CCCCCC?style=for-the-badge
[pthread-url]: https://en.wikipedia.org/wiki/POSIX_Threads