Games::Affenspiel - Play the Affenspiel game
# automatical random play script use Games::Affenspiel::Board; my $board = Games::Affenspiel::Board->new; $board->show; for (1 .. 5000) { sleep(1); my ($bar, $gap_position, $direction) = $board->choose_random_move; print "Move bar $bar in direction $direction to $gap_position\n"; $board->show; }
Games::Affenspiel is a set of Perl classes implementing the Affenspiel game play.
This package is intended to provide a basis for interactive (not yet) and automatic playing and manipulating of Affenspiel games.
Current built-in board configurations:
0) 4x5; one 2x2, four 1x1, four 1x2, one 2x1 bars, two gaps 1) 4x5; one 2x2 bar, 16 gaps (just a test board) 2) 4x5; one 2x2, four 1x1, two 1x2, three 2x1 bars, two gaps
Currently installed scripts (run with --help):
* affenspiel-random-moves * affenspiel-random-solve * affenspiel-solve
The regular Affenspiel board is comprised of 20 cells, 4 rows (numbered 1 to 4) of 5 columns (numbered 1 to 5). The cell position is written in (y, x) notation.
The original board has two gaps and following bars: one 2x2, four 1x1, four 1x2, one 2x1. The position of the left-top corner of the bar is taken as the position of the bar.
In the initial state, the 2x2 square bar is in position (1, 2),
+----+ |A/\A| |V[]V| | <> | |AOOA| |VOOV| +----+
In the final (solved) state, the 2x2 square bar is in position (4, 2)), Here is an example final board (there are many solutions):
+----+ |AOAA| |VAVV| |OV<>| | /\O| | []O| +----+
Each piece may be moved to left/right/up/down inside the board if there are enough gap(s) in that direction. No bar rotation is allowed.
Games::Affenspiel Games::Affenspiel::Board
http://www.artsoft.org/affenspiel/
http://migo.sixbit.org/software/paffenspiel/
Mikhael Goikhman <migo@homamail.com>
1 POD Error
The following errors were encountered while parsing the POD:
'=end' without a target?
To install Games::Affenspiel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Affenspiel
CPAN shell
perl -MCPAN -e shell install Games::Affenspiel
For more information on module installation, please visit the detailed CPAN module installation guide.