From 81708be1d1784f41343530e8e01a68094bc50da6 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 16 Apr 2024 17:51:05 +0200 Subject: Failed attempts to fix / debug eoesep + other changes --- test/080_allowednext/allowednext_tests.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'test/080_allowednext/allowednext_tests.c') diff --git a/test/080_allowednext/allowednext_tests.c b/test/080_allowednext/allowednext_tests.c index 7ae7f66..e531911 100644 --- a/test/080_allowednext/allowednext_tests.c +++ b/test/080_allowednext/allowednext_tests.c @@ -1,6 +1,6 @@ #include "../test.h" -bool allowednextmove(uint8_t *, int, uint8_t); +bool allowednextmove(uint8_t *, uint8_t); static char *moves[] = { "U", "U2", "U'", @@ -13,7 +13,7 @@ static char *moves[] = { int main(void) { char movestr[STRLENMAX]; - uint8_t m[100], next; + uint8_t m[100]; int n, i, j; fgets(movestr, STRLENMAX, stdin); @@ -26,17 +26,12 @@ int main(void) { if (!strcmp(movestr, moves[j])) m[i] = j; } - fgets(movestr, STRLENMAX, stdin); - movestr[strcspn(movestr, "\n")] = 0; - for (j = 0; j < 18; j++) - if (!strcmp(movestr, moves[j])) - next = 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]] : "-", - moves[next]); - printf("%s\n", allowednextmove(m, n, next) ? "true" : "false"); + n > 0 ? moves[m[n-1]] : "-"); + printf("%s\n", allowednextmove(m, n) ? "true" : "false"); return 0; } -- cgit v1.3