3 # This file is part of Language::Befunge.
4 # Copyright (c) 2001-2007 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the same terms as Perl itself.
11 #---------------------------------------#
12 # Direction changing. #
13 #---------------------------------------#
16 use Language::Befunge;
17 use POSIX qw! tmpnam !;
25 my $bef = Language::Befunge->new;
28 # In order to see what happens...
31 open OUT, ">$file" or die $!;
37 open OUT, "<$file" or die $!;
50 $bef->store_code( <<'END_OF_CODE' );
56 BEGIN { $tests += 1 };
60 $bef->store_code( <<'END_OF_CODE' );
69 BEGIN { $tests += 1 };
73 $bef->store_code( <<'END_OF_CODE' );
82 BEGIN { $tests += 1 };
86 $bef->store_code( <<'END_OF_CODE' );
93 BEGIN { $tests += 1 };
97 $bef->store_code( <<'END_OF_CODE' );
105 ok( $out, qr/^[1-4] $/ );
106 BEGIN { $tests += 1 };
110 $bef->store_code( <<'END_OF_CODE' );
119 $bef->store_code( <<'END_OF_CODE' );
128 $bef->store_code( <<'END_OF_CODE' );
136 $bef->store_code( <<'END_OF_CODE' );
143 BEGIN { $tests += 4 };
147 $bef->store_code( <<'END_OF_CODE' );
156 $bef->store_code( <<'END_OF_CODE' );
165 $bef->store_code( <<'END_OF_CODE' );
173 $bef->store_code( <<'END_OF_CODE' );
180 BEGIN { $tests += 4 };
184 $bef->store_code( <<'END_OF_CODE' );
192 $bef->store_code( <<'END_OF_CODE' );
200 $bef->store_code( <<'END_OF_CODE' );
211 $bef->store_code( <<'END_OF_CODE' );
221 BEGIN { $tests += 4 };
225 $bef->store_code( <<'END_OF_CODE' );
234 sel; # diagonal/out-of-bounds.
235 $bef->store_code( <<'END_OF_CODE' );
244 BEGIN { $tests += 2 };
247 BEGIN { plan tests => $tests };