Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: Pip-dox
Fetching contributors…

Cannot retrieve contributors at this time

file 32 lines (25 sloc) 0.539 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
use strict;
use warnings;
use SDL;
use SDLx::App;

use Game::Life;
use Data::Dumper;

my $app = SDLx::App->new( w=>400, h=> 400);

my $game = new Game::Life(100);
my $starting = [ [ 1, 1, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ];

$game->place_points( 96, 96, $starting );
for ( 1 .. 100 ) {
my $grid = $game->get_grid();
$app->draw_rect( undef, 0 );
foreach( 0..100 )
{
my $x = $_;
foreach( 0..100)
{
$app->draw_rect( [$x*4, $_*4, 4,4 ], 0xFF0000FF ) if $grid->[$x][$_];
}

}
$game->process();
$app->update();
}


sleep(2);
Something went wrong with that request. Please try again.