]> git.draconx.ca Git - rrace.git/blobdiff - t/boardmove.c
Mix in PID with initial seed.
[rrace.git] / t / boardmove.c
index 89b34603ec5d91ae7c14a6055d91b98bcb923cbf..9bc11715902e6449f9df8037dc29c1f8474d57a8 100644 (file)
@@ -1,8 +1,26 @@
+/*
+ * Helper to test game_do_move function.
+ * Copyright © 2022-2023 Nick Bowler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "game.h"
+#include "game-notime.h"
 
 static const char *progname;
 
@@ -46,7 +64,7 @@ int main(int argc, char **argv)
        const char *seq;
        int i = 0;
 
-       if (argv > 0)
+       if (argc > 0)
                progname = argv[0];
 
        if (argc != 2) {
@@ -58,7 +76,7 @@ int main(int argc, char **argv)
        board.x = get_seq(seq[i++]);
        board.y = get_seq(seq[i++]);
 
-       board.game[0] = 0x1ffffff ^ board_position(board.x, board.y);
+       board.game[0] = GAME_MASK ^ board_position(board.x, board.y);
        board.game[1] = board.game[2] = board.game[3] = board.game[0];
 
        while (1) {