|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
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>Go to the source code of this file.
Functions | |
| int | main () |
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.
| int main | ( | void | ) |
Definition at line 105 of file ca_ghost_gol_toroidal_example.cc.
References Aleph::blossom_maximum_cardinality_matching(), engine, Aleph::CA::make_game_of_life_rule(), and N.