Game-Life-Faster
view release on metacpan or search on metacpan
lib/Game/Life/Faster.pm view on Meta::CPAN
$life->place_text_points( 0, 0, 'X', <<'EOD' );
.X.
..X
XXX
EOD
The heavy lifting is done by L<set_point_state()|/set_point_state>.
=head2 process
$life->process( $iterations );
This method runs the game for the specified number of iterations, which
defaults to C<1>.
As an incompatible change to the same-named method of
L<Game::Life|Game::Life>, the number of points that actually changed
state is returned. If C<$iterations> is greater than C<1>, the return
represents the last iteration. The corresponding
L<Game::Life|Game::Life> method does not have an explicit C<return>.
=head2 set_point
$life->set_point( $x, $y );
This method sets the state of the point at position C<$x>, C<$y> of the
grid to "living." It returns a true value.
script/game-life-faster view on Meta::CPAN
are string representations of the points to be placed, with each
argument representing consecutive cells in consecutive rows. "Living"
cells are represented by C<'X'> or C<'x'>; any other character
represents a "dead" cell.
The example places a glider in the top-left corner of the grid.
=head2 process
This command causes the game to be processed. An optional parameter
specifies the number of iterations, the default being C<1>.
=head2 save
life> save life.txt
This command saves the current object in a text file which contains the
F<game-life-faster> commands needed to recreate it. These commands can be
re-executed by:
life> source life.txt
( run in 1.005 second using v1.01-cache-2.11-cpan-71847e10f99 )