https://github.com/s-mv/game-of-life
Conway's Game of Life
https://github.com/s-mv/game-of-life
c cellular-automata game-of-life
Last synced: 4 months ago
JSON representation
Conway's Game of Life
- Host: GitHub
- URL: https://github.com/s-mv/game-of-life
- Owner: s-mv
- License: gpl-3.0
- Created: 2021-01-27T06:12:12.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-12T05:41:09.000Z (about 3 years ago)
- Last Synced: 2025-03-06T00:18:23.976Z (8 months ago)
- Topics: c, cellular-automata, game-of-life
- Language: JavaScript
- Homepage:
- Size: 728 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Conway's Game of Life
> by smv
## What is this?
The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.
Read more here.
I just made it in C for fun.
Web version here.
## How to play?
### Controls
- Holding space pauses the game while releasing it resumes. When held:
- **click**/**drag** to _add cell(s)_
- **shift** + **click**/**drag** to _remove tiles_
- **right arrow key** to _move ahead by one frame_
### Custom rules
Pressing **shift** will toggle the rules bar.
The _rules_ can be something like `l3=0 m4=1 =6=0` for example
- `l` means less than, `r` means more than and `=` means, well, equal to.
- The number just after defines the number of cells.
- The number at the end defines if a cell should be alive or dead if true.
So `l3=0` translates to `if less than 3 neighbours, cell should be dead`
## How to build?
```bash
make build
```
**Run** using
```
npm run dev
```
Or serve `.` using a web server of your choice.
Or try the web version directly here :P