A feature-rich, interactive Conway's Game of Life visualizer written in Lua, using the LÖVE framework. Designed as a fun, flexible sandbox for exploring various cellular automata.
- Interactive! : Drag your mouse across the grid or click individual cells to toggle their state.
- RLE Pattern Support : Import patterns from the clipboard and export your creations back in the standard Run-Length Encoded (RLE) format.
- Custom Rulesets : Go beyond Conway's classic
B3/S23rule; the app supports any rule in the B/S notation, allowing you to explore a vast universe of different cellular automata. - Multiple Grid Modes : Choose between a
torus(wrapped edges) or afinite plane(bounded edges) to observe different pattern behaviors. - Simulation Controls : Change the grid size and simulation speed on the fly.
- Adjustable Visuals : Toggle dark/light mode, cycle through UI colors and resize the window if you feel like it.
- Download the
GameOfLife-Lua-windows.zipfile. - Extract the contents of the zip file.
- Open the extracted folder and run
GameOfLife-Lua.exe.
Note
If you have LÖVE installed, you can run it by simply downloading the GameOfLife-Lua.love file and double-clicking on it OR by running love path\to\GameOfLife-Lua.love.
-
Install the LÖVE framework. You can download it from the official website or install it using your system's package manager (e.g.,
sudo apt install loveon Debian/Ubuntu). -
Download the
GameOfLife-Lua.lovefile. -
Run the app from your terminal :
love /path/to/GameOfLife-Lua.love
Drag your mouse across the grid or click on cells to toggle their state.
| Key | Action |
|---|---|
Space |
Pause or resume the simulation. |
C |
Clear the entire grid. |
N |
Advance the simulation by one step (when paused). |
R |
Randomize the grid with a new built-in pattern. |
Esc |
Quit the application. |
| Key | Action |
|---|---|
D |
Toggle between Dark and Light mode. |
H |
Cycle through different colors. |
S |
Cycle through different simulation speeds. |
G |
Cycle through different grid sizes. |
M |
Toggle the edge wrapping mode (Torus / Bounded). |
| Key | Action |
|---|---|
Y |
Export the current pattern to the clipboard (RLE format). |
X |
Import a pattern from the clipboard (RLE format). |
L |
Import a custom rulestring (e.g., B3/S1234) from the clipboard. |
You can use the import features (X and L) to explore the vast world of cellular automata.
The application is compatible with the huge library of patterns available on the ConwayLife Wiki (look for the .rle link under the Pattern Files section on a pattern page). To import, simply copy the RLE data for a pattern and press X while in the app.
Note
- When importing patterns, make sure to copy only the core RLE data (the string of letters, numbers,
$and!), and not any header lines (lines starting with#orx = ...). For example, to display this pattern, copy only this portion:bo2bo$o4b$o3bo$4o!, and not anything above it. - Patterns can be exported to the clipboard using the
Ykey and are compatible with other viewers, such as LifeViewer.
Go beyond the standard Game of Life by importing custom rules in B/S notation. You can find a large collection of interesting rulesets on the ConwayLife Wiki's List of Life-like cellular automata.
Some interesting rules to try:
B3/S1234- Creates mazes with long, winding corridors.B1/S012345678- Generates intricate, H-shaped branches.B45678/S2345- Builds stable, walled cities.
Press the L key while inside the app to import a rule from the clipboard.
The codebase is organized into several modules :
main.lua: The main entry point. Handles the LÖVE framework lifecycle, user input, application state, and rendering.Grid.lua: The core Grid class that manages the cellular automata logic.rle.lua: Handles parsing and saving of the RLE pattern format.utils.lua: General helper functions for grid manipulation, rule parsing, etc.colors.lua: Utility functions for color manipulation and gradients.patterns.lua: Contains a collection of built-in oscillating patterns for showing on startup.conf.lua: Configuration file for the LÖVE engine (window size, title, etc.).lib/: Contains external libraries (push.luafor resolution handling andclass.lua).
- Built using the LÖVE framework.
- Virtual resolution handled by push.
- OOP support via hump.class.
- The included font is Roboto Mono by Christian Robertson.
- Inspiration and RLE format information from the ConwayLife Wiki.
This project is licensed under the MIT License.
