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/01_F_F2.in | 3 +++ test/080_allowednext/01_F_F2.out | 1 + test/080_allowednext/02_F_F2.in | 3 --- test/080_allowednext/02_F_F2.out | 1 - test/080_allowednext/02_U_F.in | 2 +- test/080_allowednext/03_R_L_R.in | 2 +- test/080_allowednext/04_longer_true.in | 2 +- test/080_allowednext/05_longer_false.in | 2 +- test/080_allowednext/06_D_U_false_order.in | 2 +- test/080_allowednext/allowednext_tests.c | 15 +++++---------- 10 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 test/080_allowednext/01_F_F2.in create mode 100644 test/080_allowednext/01_F_F2.out delete mode 100644 test/080_allowednext/02_F_F2.in delete mode 100644 test/080_allowednext/02_F_F2.out (limited to 'test/080_allowednext') diff --git a/test/080_allowednext/01_F_F2.in b/test/080_allowednext/01_F_F2.in new file mode 100644 index 0000000..93f0a9c --- /dev/null +++ b/test/080_allowednext/01_F_F2.in @@ -0,0 +1,3 @@ +2 +F +F2 diff --git a/test/080_allowednext/01_F_F2.out b/test/080_allowednext/01_F_F2.out new file mode 100644 index 0000000..c508d53 --- /dev/null +++ b/test/080_allowednext/01_F_F2.out @@ -0,0 +1 @@ +false diff --git a/test/080_allowednext/02_F_F2.in b/test/080_allowednext/02_F_F2.in deleted file mode 100644 index 06f504f..0000000 --- a/test/080_allowednext/02_F_F2.in +++ /dev/null @@ -1,3 +0,0 @@ -1 -F -F2 diff --git a/test/080_allowednext/02_F_F2.out b/test/080_allowednext/02_F_F2.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowednext/02_F_F2.out +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/080_allowednext/02_U_F.in b/test/080_allowednext/02_U_F.in index 3a41149..ad3607e 100644 --- a/test/080_allowednext/02_U_F.in +++ b/test/080_allowednext/02_U_F.in @@ -1,3 +1,3 @@ -1 +2 U F diff --git a/test/080_allowednext/03_R_L_R.in b/test/080_allowednext/03_R_L_R.in index e215381..ffd9542 100644 --- a/test/080_allowednext/03_R_L_R.in +++ b/test/080_allowednext/03_R_L_R.in @@ -1,4 +1,4 @@ -2 +3 R L' R2 diff --git a/test/080_allowednext/04_longer_true.in b/test/080_allowednext/04_longer_true.in index e1f1d62..0360619 100644 --- a/test/080_allowednext/04_longer_true.in +++ b/test/080_allowednext/04_longer_true.in @@ -1,4 +1,4 @@ -10 +11 F2 B D2 diff --git a/test/080_allowednext/05_longer_false.in b/test/080_allowednext/05_longer_false.in index 6befeff..6cf8ecd 100644 --- a/test/080_allowednext/05_longer_false.in +++ b/test/080_allowednext/05_longer_false.in @@ -1,4 +1,4 @@ -7 +8 D B2 F' diff --git a/test/080_allowednext/06_D_U_false_order.in b/test/080_allowednext/06_D_U_false_order.in index 7bfd8c2..680d1a1 100644 --- a/test/080_allowednext/06_D_U_false_order.in +++ b/test/080_allowednext/06_D_U_false_order.in @@ -1,3 +1,3 @@ -1 +2 D U 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