#!perl use Test::More; eval 'use Test::MockModule;'; if($@) { plan( skip_all => q{missing Test::MockModule} ); } else { plan( tests => 1 ); } use FindBin; use lib "$FindBin::Bin/lib"; use TestString; use MazeTestUtils; use Games::Maze::SVG; use strict; use warnings; my $gmaze = Test::MockModule->new( 'Games::Maze' ); my $output = do { local $/ = undef; ; }; $gmaze->mock( make => sub { my $self = shift; $self->{entry} = [2,1,1]; $self->{exit} = [6,8,1]; }, to_ascii => sub { normalize_maze( <<'EOM' ); }, __ / \__ __/ \ \__ __/ \ \__ \__ / / \__/ __/ \ \ / \ / \__ / / \__ \__ \__/ \ \ \__/ \ / __/ / \__ / \__ \ \ / \__/ \ / \ / / \ / __/ / \ \__ \ / \__/ \ / \__/ \ __/ \__ \__/ \__/ EOM ); # Default constructor. my $maze = Games::Maze::SVG->new( 'Hex', cols => 3, rows => 3 ); $maze->set_interactive(); #open( my $fh, '>hex1.svg' ) or die; #print $fh $maze->toString(); is_string( $maze->toString(), $output, "Full transform works." ); __DATA__ A Playable SVG Maze This maze was generated using the Games::Maze::SVG Perl module. SVG Maze 2006 An SVG-based Game G. Wade Johnson G. Wade Johnson 00000001110000000 00000011011000000 00001110001110000 00011011011011000 01110001110001110 11011011011011011 10001110001110001 11011011011011011 01110001110001110 11011011011011011 10001110001110001 11011011011011011 01110001110001110 11011011011011011 10001110001110001 11011011011011011 01110001110001110 00011011011011000 00001110001110000 00000011011000000 00000001110000000 00000000000000000 00000000000000000 00000000000000000 00000000000000000 Entry Exit Begin Save Back Move View Click Begin button to start Use the arrow keys to move the sprite Hold the shift to move quickly. The mouse must remain over the maze for the keys to work. Use arrow buttons to shift the maze Center button centers view on sprite Save button saves current position Back button restores last position Solved!