Expand description
Conway’s Game of Life implementation for TUI background animation.
This module provides a cellular automaton simulation using Braille patterns for rendering. It includes various seed patterns (gliders, spaceships, etc.) and automatic pattern injection when activity becomes low.
Structs§
- Life
Config - Configuration for the Life simulation injector.
- Life
Field - The Game of Life field state.
- Pattern
Placement - Placement configuration for injecting a pattern into the life field.
- Seed
Pattern - A predefined seed pattern for the Game of Life.
- Zone
Stats - Statistics for a single zone in the life field.
Constants§
- ACORN_
PATTERN - The acorn pattern - a methuselah that evolves for 5206 generations.
- GLIDER_
PATTERN - The glider pattern - a small spaceship that moves diagonally.
- LWSS_
PATTERN - The lightweight spaceship (LWSS) pattern - moves orthogonally.
- RANDOM_
BLOB_ 4X4 - Small random blob pattern (4x4) for variety
- RANDOM_
BLOB_ 5X5 - Medium random blob pattern (5x5) for variety
- RANDOM_
BLOB_ 6X6 - Large random blob pattern (6x6) for variety
- R_
PENTOMINO_ PATTERN - The R-pentomino pattern - a small methuselah that evolves for many generations.
Functions§
- hash_
seed - Generate a deterministic seed from prompt and dimensions
- rotate_
cell - Rotates a cell coordinate within a pattern.
- rotated_
dimensions - Calculates dimensions after rotation.
- wrap_
index - Wraps an index with a delta, handling toroidal boundaries.
- wrap_
index_ signed - Wraps a signed index, handling toroidal boundaries.