PHP implementation of Game of Life.
php run.php game:run -i input.xml -o output.xm
Parameter -i
is optional, default value is input.xml
.
Parameter -o
is optional, default value is output.xml
.
<?xml version="1.0"?>
<life>
<world>
<cells>4</cells> <!-- Dimension of the square "world" -->
<species>1</species> <!-- Number of distinct species -->
<iterations>10</iterations> <!-- Number of iterations to be calculated -->
</world>
<organisms>
<organism>
<x_pos>2</x_pos> <!-- x position -->
<y_pos>0</y_pos> <!-- y position -->
<species>0</species> <!-- Species type -->
</organism>
<organism>
<x_pos>0</x_pos>
<y_pos>1</y_pos>
<species>0</species>
</organism>
<organism>
<x_pos>3</x_pos>
<y_pos>1</y_pos>
<species>0</species>
</organism>
<organism>
<x_pos>0</x_pos>
<y_pos>2</y_pos>
<species>0</species>
</organism>
<organism>
<x_pos>3</x_pos>
<y_pos>2</y_pos>
<species>0</species>
</organism>
<organism>
<x_pos>1</x_pos>
<y_pos>3</y_pos>
<species>0</species>
</organism>
</organisms>
</life>
Tests are written in PHPUnit.
composer test