#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. | |
| const PtrRaster< Value, 2 > & | generate (long count) |
| Generate lifes at random positions. More... | |
| const VecRaster< Value, 3 > & | run () |
| Run the game. | |
| long | next () |
| Move to the next frame. | |
| const PtrRaster< Value, 2 > & | update () |
| Update the current frame. | |
| long | countLifes (const Position< 2 > &p) const |
| Count lifes around a given position. | |
| bool | isInDomain (const Position< 2 > &p) const |
| Check whether a given position is in the board domain. | |