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

Game of Life on a Ghost_Lattice with toroidal borders. More...

#include <iostream>
#include <utility>
#include <ca-traits.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_ghost_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_engine.H>
Include dependency graph for ca_ghost_gol_toroidal_example.cc:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

Game of Life on a Ghost_Lattice with toroidal borders.

Drops the canonical 5-cell glider onto a 12x12 Ghost_Lattice with PeriodicBoundary (halo radius = 1), runs Conway's Game of Life for 48 steps and prints every 4th frame. The glider walks diagonally and seamlessly re-enters from the opposite edge when it crosses the border, proving that the halo refresh is correct every step.

Run it to see a glider travel across the torus:

$ ./build/Examples/ca_ghost_gol_toroidal_example

Definition in file ca_ghost_gol_toroidal_example.cc.

Function Documentation

◆ main()