An open API service indexing awesome lists of open source software.

https://github.com/srvariable/gol

The mythical Conway's Game of Life
https://github.com/srvariable/gol

c conways-game-of-life raylib

Last synced: about 1 year ago
JSON representation

The mythical Conway's Game of Life

Awesome Lists containing this project

README

          

# GOL

The mythical Conway's Game of Life made in C using [raylib](https://github.com/raysan5/raylib).

# Preview

[preview.webm](https://github.com/SrVariable/GOL/assets/96599624/5661c44a-a311-429a-9292-a2223cad5a9f)

# Installation

## Debian / Ubuntu

```shell
sudo apt update && sudo apt install build-essential git \
libasound2-dev libx11-dev libxrandr-dev libxi-dev \
libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev \
libxinerama-dev libwayland-dev libxkbcommon-dev
```

## Windows

Follow steps 1, 2, 3: https://github.com/raysan5/raylib/wiki/Working-on-Windows#manual-setup-with-w64devkit

# Controls

|Key|Description|
|-|-|
|B|Blinker|
|G|Glider / Gospel Gun Glider|
|Left Click|Put cell|
|Right Click|Remove cell|
|.|Increase speed|
|,|Decrease speed|
|Space|Pause / Play game|
|R|Restart board|

> [!NOTE]
> If you press Shift when using a key to select a pattern, it will switch reversed.

# How to play

Execute ```make run``` and it will start the game. Left click to put an alive cell or right click to put a dead cell.
To put a pattern, hold its respective key and left click. For example G Left Click will place
a Glider in the selected zone.

# References

- Game of Life: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
- Patterns: https://www.researchgate.net/figure/Selected-morphologies-in-the-Game-of-Life-Their-identification-in-the-environment_fig5_318515088
- Gospel Gun Glider: https://conwaylife.com/patterns/gosperglidergun.cells
- Raylib: https://github.com/raysan5/raylib/blob/master/src/raylib.h

# Contributing

If you find any bug or have any suggestion, please open an issue [here](https://github.com/SrVariable/BFL/issues/new).