https://github.com/ugnmura/game-of-life
Simulation of Conway's Game of Life
https://github.com/ugnmura/game-of-life
gpu gpu-computing gpujs nextjs p5 p5js react shaders typescript webgl webgl2
Last synced: 7 months ago
JSON representation
Simulation of Conway's Game of Life
- Host: GitHub
- URL: https://github.com/ugnmura/game-of-life
- Owner: ugnmura
- License: mit
- Created: 2022-03-28T16:54:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-08T20:50:49.000Z (about 2 years ago)
- Last Synced: 2025-02-15T02:35:35.779Z (9 months ago)
- Topics: gpu, gpu-computing, gpujs, nextjs, p5, p5js, react, shaders, typescript, webgl, webgl2
- Language: TypeScript
- Homepage: https://sushiwaumai.github.io/game-of-life/
- Size: 179 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Conway's Game of life simulation
## What is Conway's Game of Life?
Conway's Game of life is a cellular automaton devised by the British mathematician John Horton Conway in 1970.
## How does it work?
The rules of the game are simple:
1. Any **live** cell with fewer than two live neighbours **dies**, as if caused by under-population.
2. Any **live** cell with two or three live neighbours **lives** on to the next generation.
3. Any **live** cell with more than three live neighbours **dies**, as if by overcrowding.
4. Any **dead** cell with exactly three live neighbours becomes a **live** cell, as if by reproduction.
[By Wikipedia, the free encyclopedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life)
## How do I play?
This Simulation is available on [GitHub Pages](https://sushiwaumai.github.io/Game-of-Life/).
The game is played by clicking on the cells.
1. Left click on a cell to make it alive.
2. Right click on a cell to make it dead.
3. Middle click and drag to select a region.
4. Press the `Space` key to start the simulation. Press it again to stop it.
5. Press `h` to randomize the board.
6. Press `r` to reset the board.
7. Press `k` to reset the position of the camera.
8. Press `b` to remove the selected region.
9. Press `c` to copy the current selected region.
10. Press `v` to paste the copied region.
11. Press `Enter` to move to the next generation.
## Development
### Prerequisites
- node.js
- pnpm
### Getting Started
Clone the repository and install dependencies:
```bash
# Clone the repo
git clone https://github.com/SushiWaUmai/Game-of-Life.git && cd Game-of-Life
pnpm i
```
Start developing:
```bash
pnpm run dev
```