How glebdot/cellularautomata works
This is an interactive cellular-automata sandbox: users select a material and brush size, paint cells, and watch four material behaviors evolve on a grid. The main loop in Application connects configuration loading, painting, simulation steps, and rendering. The grid schedules active cells through a deduplicating FIFO queue; cell rules mutate the grid through swaps. The README also describes the four matter types and their interactions. Wiring is based on the sampled application, parser, grid, and cell sources; no additional unsampled runtime subsystems are inferred.
Main entry points: CellGrid.cpp Cell grid · Application.cpp Application loop · Parser.cpp Config parser · Cell.cpp Matter rules
Components 14
Interactive application
- Program entry
CellularAutomata/CellularAutomata.cpp - Application loop
CellularAutomata/Application.cpp - Material brush
CellularAutomata/Application.cpp - Grid and HUD
CellularAutomata/Application.cpp
Simulation engine
- Matter traits
CellularAutomata/core/Cell.h - Cell grid
CellularAutomata/core/CellGrid.cpp - Cell defaults
CellularAutomata/core/CellGrid.cpp - Matter rules
CellularAutomata/core/Cell.cpp - Update scheduler
CellularAutomata/utils/UniqueQueue.h - Matter type mapping
CellularAutomata/core/CoreTypes.cpp
Matter configuration
- Config parser
CellularAutomata/input/Parser.cpp - Matter settings
CellularAutomata/config.txt
Other components
- Player
- SFML window
Connections 20
- Player → SFML window: interacts
- Program entry → Application loop: starts
- Application loop → Config parser: parses settings
- Config parser → Matter settings: reads
- Config parser → Matter type mapping: maps type
- Config parser → Matter traits: produces
- Application loop → Cell grid: initializes and loads
- Cell grid → Cell defaults: builds defaults
- Cell grid → Matter traits: uses traits
- Material brush → Cell grid: creates cells
- Application loop → Material brush: handles input
- Application loop → Cell grid: steps simulation
- Cell grid → Update scheduler: queues updates
- Cell grid → Matter rules: dispatches steps
- Matter rules → Cell grid: checks and swaps
- Grid and HUD → Cell grid: reads cells
- Grid and HUD → Cell defaults: reads selected matter
- Application loop → Grid and HUD: draws frame
- Application loop → SFML window: polls and displays
- SFML window → Application loop: events and input