2 * Helper to test game_check_goal function.
3 * Copyright © 2022-2023 Nick Bowler
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 #include "game-notime.h"
29 static const char *progname = "checkgoal";
31 int main(int argc, char **argv)
39 while ((rc = scanf(X3("%" SCNxLEAST32) X3("%" SCNxLEAST16),
40 &board.game[0], &board.game[1],
41 &board.game[2], &board.goal[0],
42 &board.goal[1], &board.goal[2])) == 6)
44 printf("%.5" PRIxFAST32 "\n", game_check_goal(&board));
49 fprintf(stderr, "%s: read error: %s\n", progname,
57 fprintf(stderr, "%s: invalid input sequence\n", progname);