From b0053277e385bee23336d1fe6b69a12f49f9172f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 1 Apr 2025 09:33:26 +0200 Subject: simplified allowedmoves logic --- test/080_allowednext/allowednext_tests.c | 35 -------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 test/080_allowednext/allowednext_tests.c (limited to 'test/080_allowednext/allowednext_tests.c') diff --git a/test/080_allowednext/allowednext_tests.c b/test/080_allowednext/allowednext_tests.c deleted file mode 100644 index 08fe491..0000000 --- a/test/080_allowednext/allowednext_tests.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "../test.h" - -bool allowednextmove(size_t n, const uint8_t [n]); - -static char *moves[] = { - "U", "U2", "U'", - "D", "D2", "D'", - "R", "R2", "R'", - "L", "L2", "L'", - "F", "F2", "F'", - "B", "B2", "B'", -}; - -void run(void) { - char movestr[STRLENMAX]; - uint8_t m[100]; - int n, i, j; - - fgets(movestr, STRLENMAX, stdin); - n = atoi(movestr); - - for (i = 0; i < n; i++) { - fgets(movestr, STRLENMAX, stdin); - movestr[strcspn(movestr, "\n")] = 0; - for (j = 0; j < 18; j++) - if (!strcmp(movestr, moves[j])) - m[i] = j; - } - - fprintf(stderr, "Last two: %s, %s\nNext: %s\n", - n > 2 ? moves[m[n-3]] : "-", - n > 1 ? moves[m[n-2]] : "-", - n > 0 ? moves[m[n-1]] : "-"); - printf("%s\n", allowednextmove(n, m) ? "true" : "false"); -} -- cgit v1.3