This program allows you to create cellular automata based on a given world file.
- Quick start
- World file syntax
- Json gui setting
- Modifying 'Game of life' rule
- Implemented automata
- Todo
mkdir build
cmake -S . -B build
cmake --build build
As console app
./aca worlds/gol.world
As graphich app (use Raylib)
./aca worlds/gol.world worlds/gui/gol.json
Key | Action |
---|---|
Esc | exit from application |
Space | toggle pause |
I | toggle viewing count of iterations |
B | toggle speed 50 FPS <-> 500 FPS 20 ms <-> 2 ms |
N | step in simulation if set pause |
Words, numbers and symbols separated by spacing symbols (space, tab, new line and etc.), Tabulation and line feed it does not matter.
See the other syntax in the EBNF, example file and documentation.
may statement in if block checking via and
'a' may 1 2 3
'b' may 4 5 6
'c' may 7 8 9
as 'a' and 'b' and 'c'
numbers in may statement checking via or
'a' may 1 2 3
as 1 or 2 or 3
Show example with 'Game of life' gui
{
"pixel": {
"width" : 10,
"height": 10
},
"dict": {
".": [ 24, 24, 24],
"#": [231, 231, 231]
}
}
Where field:
pixel
contains self sizedict
contains matched char with color (in RGB)
Colors in dict
must be unique because char matched to color and color matched to char
Rules for original game maybe present as B3/S23
, where B
- birth, S
- survive
Template:
world 80 30 '.' 2
'.' ; dead
'#' ; live
alias end
rules count
state '.' to '#' if '#' may
; numbers in 'B'
end
state '#' to '.' if '#' nomay
; numbers in 'S'
end
end
setup
; your setup of world
end
Exapmles: B3/S23, B35678/S5678, B2/S, B3678/S34678
For gui use gol.json
- Conway's Game of Life, Wikipedia
- Life-like cellular automaton
- Brian's Brain, Wikipedia
- Langton's ant, Wikipedia
- Wireworld, Wikipedia
- Belousov–Zhabotinsky reaction (simple), Wikipedia
- Add pattern rule
- Add comments in world file
- Add alias statement for symbols