https://github.com/akihiko47/rockpaperscissors_cellular-automata
A cell change colour when the number of neighbouring cells that beats it is above a threshold. 1 beats 2 / 2 beats 3 / 3 beats 1
https://github.com/akihiko47/rockpaperscissors_cellular-automata
algorithm cellular-automata generative-art pygame python rock-paper-scissors
Last synced: 8 months ago
JSON representation
A cell change colour when the number of neighbouring cells that beats it is above a threshold. 1 beats 2 / 2 beats 3 / 3 beats 1
- Host: GitHub
- URL: https://github.com/akihiko47/rockpaperscissors_cellular-automata
- Owner: akihiko47
- Created: 2023-10-08T12:23:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-08T13:04:23.000Z (about 2 years ago)
- Last Synced: 2025-02-16T04:31:41.525Z (10 months ago)
- Topics: algorithm, cellular-automata, generative-art, pygame, python, rock-paper-scissors
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🧬 Rock Paper Scissors 🧬

In this simulation, every pixel is a cell. In the likes of John Conway's Game of Life, at each simulation step, every cell decides its next color based on its neighbors' colors. Unlike Conway's game, though, there are three states (or colors) instead of just "dead" or "alive". Here's where the rock paper scissors analogy comes into play. Whenever a cell of a certain category is confronted with another of a different category, it will either "eat" or be "eaten" by the other. The rules are:
- C eats B
- B eats A
- A eats C
## Settings ⚙️
1. `matrix_size = 100` - size of cells field (n x n)
2. `cube_size = 10` - size of one cell (in pixels)
3. `rand = True` - add some randomization (makes game more organic)
4. `rand_cof = 1` - how random is mode above
5. `near_win_count = 2` - how many cells need to eat another cell
## Controls 🎮
1. draw - mouse
2. change pen color - 1 / 2 / 3
3. start - space
4. color scheme - left arrow / right arrow
5. intensity - up arrow / down arrow
6. max FPS - minus / plus
7. restart - escape
You can also find controls in `controls.txt`
## Contributions
Contributions are welcomed! 👋