Why not adopt me?This distribution is up for adoption! If you're interested then please contact the PAUSE module admins via email.
- SEE ALSO
Games::Tetris - representation of a tetris game state
use Games::Tetris; my $well = Games::Tetris->new; my $ess = $well->new_shape(' +', '++', '+ '); $well->drop( $ess, 3, 1 ); $well->print;
This module can be used as the rules engine for the game of tetris. It allows you to create a well and drop pieces in it. The well tracks the status its contents and handles completed line removal.
Creates a new gamestate
Takes the following optional parameters:
well an initial well, an array of arrays. use undef to indicate an empty cell, any other value is considered occupied
depth dimensions of a new well (defaults to 15 x 20)
delegates to Games::Tetris::Shape->new
used by the testsuite. prrints the current state of the well
returns a true value if the given shape would fit in the well at the location
returns false if the shape will not fit at the location indicated by
if the shape can be dropped it will be advanced to the bottom of the well and the return value will be the rows removed by the dropping operation, if any, as an array reference
Richard Clamp <email@example.com>
Copyright (C) 2003 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.