1 # Copyright © 2022 Nick Bowler
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 AT_SETUP([board bitmap functions])
18 AT_CHECK([boardbit], [0],
19 [[left(0) left(1) left(2) left(3) left(4)
20 @.... @@... @@@.. @@@@. @@@@@
21 @.... @@... @@@.. @@@@. @@@@@
22 @.... @@... @@@.. @@@@. @@@@@
23 @.... @@... @@@.. @@@@. @@@@@
24 @.... @@... @@@.. @@@@. @@@@@
26 right(0) right(1) right(2) right(3) right(4)
27 @@@@@ .@@@@ ..@@@ ...@@ ....@
28 @@@@@ .@@@@ ..@@@ ...@@ ....@
29 @@@@@ .@@@@ ..@@@ ...@@ ....@
30 @@@@@ .@@@@ ..@@@ ...@@ ....@
31 @@@@@ .@@@@ ..@@@ ...@@ ....@
33 above(0) above(1) above(2) above(3) above(4)
34 @@@@@ @@@@@ @@@@@ @@@@@ @@@@@
35 ..... @@@@@ @@@@@ @@@@@ @@@@@
36 ..... ..... @@@@@ @@@@@ @@@@@
37 ..... ..... ..... @@@@@ @@@@@
38 ..... ..... ..... ..... @@@@@
40 below(0) below(1) below(2) below(3) below(4)
41 @@@@@ ..... ..... ..... .....
42 @@@@@ @@@@@ ..... ..... .....
43 @@@@@ @@@@@ @@@@@ ..... .....
44 @@@@@ @@@@@ @@@@@ @@@@@ .....
45 @@@@@ @@@@@ @@@@@ @@@@@ @@@@@
50 AT_SETUP([game_do_move zigzag])
52 AT_CHECK([boardmove m4_do(
211 AT_SETUP([game_do_move vertical])
213 AT_CHECK([boardmove m4_do(
218 [424143404442])], [0],
402 AT_SETUP([game_do_move horizontal])
404 AT_CHECK([boardmove m4_do(
409 [243414440424])], [0],
593 AT_SETUP([xoshiro256** sanity])
595 AT_CHECK([rng-test >out
596 grep -v '^ok' out], [0], [1..200
601 AT_SETUP([game_check_goal])
603 AT_DATA([boards.dat],
605 1f8c63f 1f8c63f 1f8c63f 0000 0000 0000
606 1f8c63f 1f8c63f 1f8c63f ffff 0000 0000
607 1f8c63f 1f8c63f 1f8c63f 0000 ffff 0000
608 1f8c63f 1f8c63f 1f8c63f 0000 0000 ffff
609 00739c0 1f8c63f 1f8c63f ffff 0000 0000
610 1f8c63f 00739c0 1f8c63f 0000 ffff 0000
611 1f8c63f 1f8c63f 00739c0 0000 0000 ffff
612 0000000 0000000 0000000 0001 0020 0400
627 AT_CHECK([checkgoal <boards.dat >result.dat && cat result.dat], [0], [expout])