SimLife is a high-performance Conway's Game of Life simulator written in the Odin programming language. It features a graphical interactive mode powered by Raylib and a headless benchmark mode for performance testing.
- Look-Up Table: Pre-calculated LUT for all possible Cell States.
- Ghost Cells: Padded memory to safely skip bound checks and handle wrap-around logic.
- Odin Compiler (latest version)
To run the project, use the Odin compiler. It is recommended to use -o:speed for release builds to ensure smooth performance, especially with large grids.
Run the simulation in a window:
odin run src/ -o:speedRun a headless benchmark to measure simulation steps per second:
odin run src/ -o:speed -- -bench -gen=5000Note: The -- separator is required to pass flags to the program instead of the compiler.
You can customize the simulation using the following command-line arguments:
| Flag | Default | Description |
|---|---|---|
-width |
600 | Window width in pixels |
-height |
600 | Window height in pixels |
-grid-w |
10000 | Simulation grid width (cells) |
-grid-h |
10000 | Simulation grid height (cells) |
-gen |
1 | Number of generations to simulate in benchmark |
-bench |
false | Enable benchmark mode (disables window) |
src/main.odin: Entry point, CLI argument parsing, and main loop management.src/simulator/core.odin: Core simulation logic (state management, step function).src/config/settings.odin: Default configuration constants.
MIT License
