Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ca_game_of_life_example.cc File Reference

Conway's Game of Life over a toroidal 2D lattice. More...

#include <chrono>
#include <cerrno>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include <ca-traits.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_lattice.H>
#include <ca-engine-utils.H>
Include dependency graph for ca_game_of_life_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Conway's Game of Life over a toroidal 2D lattice.

Builds a Phase 3 Synchronous_Engine through make_gol_engine(), stamps one of the canonical Life patterns into the initial frame and renders each synchronous step in-place on stdout.

Usage: ca_game_of_life_example [pattern] [steps] [width] [height]

Available patterns: block — 2x2 still life blinker — period-2 oscillator toad — period-2 oscillator beacon — period-2 oscillator glider — diagonal spaceship (default) r-pentomino — methuselah; long-lived chaotic activity gosper — Gosper glider gun

Defaults: glider, 40 steps, 32x16 toroidal grid.

Definition in file ca_game_of_life_example.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)