#include <GameOfLife.h>
A Game of Life as an example usage of Raster
and a few features like slicing.
Public Types | |
using | Value = unsigned char |
The cell type. | |
Public Member Functions | |
GameOfLife (long width, long height, long turns) | |
Constructor. | |
long | count_lives (const Position< 2 > &p) const |
Count lives around a given position. | |
const PtrRaster< Value, 2 > & | generate (long count) |
Generate lives at random positions. More... | |
bool | is_in_domain (const Position< 2 > &p) const |
Check whether a given position is in the board domain. | |
long | next () |
Move to the next frame. | |
const VecRaster< Value, 3 > & | run () |
Run the game. | |
const PtrRaster< Value, 2 > & | update () |
Update the current frame. | |