From c9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 3 Sep 2024 21:52:16 +0200 Subject: Moved stuff around --- test/082_allowednext_h48/00_empty_U.in | 3 -- test/082_allowednext_h48/00_empty_U.out | 1 - test/082_allowednext_h48/01_F.in | 4 --- test/082_allowednext_h48/01_F.out | 1 - test/082_allowednext_h48/02_U2.in | 3 -- test/082_allowednext_h48/02_U2.out | 1 - test/082_allowednext_h48/03_R_L.in | 5 --- test/082_allowednext_h48/03_R_L.out | 1 - test/082_allowednext_h48/04_D.in | 3 -- test/082_allowednext_h48/04_D.out | 1 - test/082_allowednext_h48/05_U_F_B2.in | 5 --- test/082_allowednext_h48/05_U_F_B2.out | 1 - test/082_allowednext_h48/06_empty_bound.in | 2 -- test/082_allowednext_h48/06_empty_bound.out | 1 - test/082_allowednext_h48/07_F_bound.in | 3 -- test/082_allowednext_h48/07_F_bound.out | 1 - test/082_allowednext_h48/08_U_D_bound_inverse.in | 4 --- test/082_allowednext_h48/08_U_D_bound_inverse.out | 1 - test/082_allowednext_h48/09_R_false_bound.in | 3 -- test/082_allowednext_h48/09_R_false_bound.out | 1 - test/082_allowednext_h48/allowednext_h48_tests.c | 38 ----------------------- test/130_allowednext_h48/00_empty_U.in | 3 ++ test/130_allowednext_h48/00_empty_U.out | 1 + test/130_allowednext_h48/01_F.in | 4 +++ test/130_allowednext_h48/01_F.out | 1 + test/130_allowednext_h48/02_U2.in | 3 ++ test/130_allowednext_h48/02_U2.out | 1 + test/130_allowednext_h48/03_R_L.in | 5 +++ test/130_allowednext_h48/03_R_L.out | 1 + test/130_allowednext_h48/04_D.in | 3 ++ test/130_allowednext_h48/04_D.out | 1 + test/130_allowednext_h48/05_U_F_B2.in | 5 +++ test/130_allowednext_h48/05_U_F_B2.out | 1 + test/130_allowednext_h48/06_empty_bound.in | 2 ++ test/130_allowednext_h48/06_empty_bound.out | 1 + test/130_allowednext_h48/07_F_bound.in | 3 ++ test/130_allowednext_h48/07_F_bound.out | 1 + test/130_allowednext_h48/08_U_D_bound_inverse.in | 4 +++ test/130_allowednext_h48/08_U_D_bound_inverse.out | 1 + test/130_allowednext_h48/09_R_false_bound.in | 3 ++ test/130_allowednext_h48/09_R_false_bound.out | 1 + test/130_allowednext_h48/allowednext_h48_tests.c | 38 +++++++++++++++++++++++ 42 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 test/082_allowednext_h48/00_empty_U.in delete mode 100644 test/082_allowednext_h48/00_empty_U.out delete mode 100644 test/082_allowednext_h48/01_F.in delete mode 100644 test/082_allowednext_h48/01_F.out delete mode 100644 test/082_allowednext_h48/02_U2.in delete mode 100644 test/082_allowednext_h48/02_U2.out delete mode 100644 test/082_allowednext_h48/03_R_L.in delete mode 100644 test/082_allowednext_h48/03_R_L.out delete mode 100644 test/082_allowednext_h48/04_D.in delete mode 100644 test/082_allowednext_h48/04_D.out delete mode 100644 test/082_allowednext_h48/05_U_F_B2.in delete mode 100644 test/082_allowednext_h48/05_U_F_B2.out delete mode 100644 test/082_allowednext_h48/06_empty_bound.in delete mode 100644 test/082_allowednext_h48/06_empty_bound.out delete mode 100644 test/082_allowednext_h48/07_F_bound.in delete mode 100644 test/082_allowednext_h48/07_F_bound.out delete mode 100644 test/082_allowednext_h48/08_U_D_bound_inverse.in delete mode 100644 test/082_allowednext_h48/08_U_D_bound_inverse.out delete mode 100644 test/082_allowednext_h48/09_R_false_bound.in delete mode 100644 test/082_allowednext_h48/09_R_false_bound.out delete mode 100644 test/082_allowednext_h48/allowednext_h48_tests.c create mode 100644 test/130_allowednext_h48/00_empty_U.in create mode 100644 test/130_allowednext_h48/00_empty_U.out create mode 100644 test/130_allowednext_h48/01_F.in create mode 100644 test/130_allowednext_h48/01_F.out create mode 100644 test/130_allowednext_h48/02_U2.in create mode 100644 test/130_allowednext_h48/02_U2.out create mode 100644 test/130_allowednext_h48/03_R_L.in create mode 100644 test/130_allowednext_h48/03_R_L.out create mode 100644 test/130_allowednext_h48/04_D.in create mode 100644 test/130_allowednext_h48/04_D.out create mode 100644 test/130_allowednext_h48/05_U_F_B2.in create mode 100644 test/130_allowednext_h48/05_U_F_B2.out create mode 100644 test/130_allowednext_h48/06_empty_bound.in create mode 100644 test/130_allowednext_h48/06_empty_bound.out create mode 100644 test/130_allowednext_h48/07_F_bound.in create mode 100644 test/130_allowednext_h48/07_F_bound.out create mode 100644 test/130_allowednext_h48/08_U_D_bound_inverse.in create mode 100644 test/130_allowednext_h48/08_U_D_bound_inverse.out create mode 100644 test/130_allowednext_h48/09_R_false_bound.in create mode 100644 test/130_allowednext_h48/09_R_false_bound.out create mode 100644 test/130_allowednext_h48/allowednext_h48_tests.c (limited to 'test') diff --git a/test/082_allowednext_h48/00_empty_U.in b/test/082_allowednext_h48/00_empty_U.in deleted file mode 100644 index 28271a6..0000000 --- a/test/082_allowednext_h48/00_empty_U.in +++ /dev/null @@ -1,3 +0,0 @@ -0 -0 - diff --git a/test/082_allowednext_h48/00_empty_U.out b/test/082_allowednext_h48/00_empty_U.out deleted file mode 100644 index 8607955..0000000 --- a/test/082_allowednext_h48/00_empty_U.out +++ /dev/null @@ -1 +0,0 @@ -0x3FFFF diff --git a/test/082_allowednext_h48/01_F.in b/test/082_allowednext_h48/01_F.in deleted file mode 100644 index e7ae375..0000000 --- a/test/082_allowednext_h48/01_F.in +++ /dev/null @@ -1,4 +0,0 @@ -0 -1 -F - diff --git a/test/082_allowednext_h48/01_F.out b/test/082_allowednext_h48/01_F.out deleted file mode 100644 index 5d6f843..0000000 --- a/test/082_allowednext_h48/01_F.out +++ /dev/null @@ -1 +0,0 @@ -0x38FFF diff --git a/test/082_allowednext_h48/02_U2.in b/test/082_allowednext_h48/02_U2.in deleted file mode 100644 index 2c5ee5f..0000000 --- a/test/082_allowednext_h48/02_U2.in +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -U diff --git a/test/082_allowednext_h48/02_U2.out b/test/082_allowednext_h48/02_U2.out deleted file mode 100644 index a9a5adb..0000000 --- a/test/082_allowednext_h48/02_U2.out +++ /dev/null @@ -1 +0,0 @@ -0x3FFF8 diff --git a/test/082_allowednext_h48/03_R_L.in b/test/082_allowednext_h48/03_R_L.in deleted file mode 100644 index b6c0625..0000000 --- a/test/082_allowednext_h48/03_R_L.in +++ /dev/null @@ -1,5 +0,0 @@ -0 -2 -R -L' - diff --git a/test/082_allowednext_h48/03_R_L.out b/test/082_allowednext_h48/03_R_L.out deleted file mode 100644 index a4aa4b2..0000000 --- a/test/082_allowednext_h48/03_R_L.out +++ /dev/null @@ -1 +0,0 @@ -0x3F03F diff --git a/test/082_allowednext_h48/04_D.in b/test/082_allowednext_h48/04_D.in deleted file mode 100644 index 83da556..0000000 --- a/test/082_allowednext_h48/04_D.in +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -D diff --git a/test/082_allowednext_h48/04_D.out b/test/082_allowednext_h48/04_D.out deleted file mode 100644 index fe91843..0000000 --- a/test/082_allowednext_h48/04_D.out +++ /dev/null @@ -1 +0,0 @@ -0x3FFC0 diff --git a/test/082_allowednext_h48/05_U_F_B2.in b/test/082_allowednext_h48/05_U_F_B2.in deleted file mode 100644 index 67e090f..0000000 --- a/test/082_allowednext_h48/05_U_F_B2.in +++ /dev/null @@ -1,5 +0,0 @@ -0 -2 -U -F - diff --git a/test/082_allowednext_h48/05_U_F_B2.out b/test/082_allowednext_h48/05_U_F_B2.out deleted file mode 100644 index 5d6f843..0000000 --- a/test/082_allowednext_h48/05_U_F_B2.out +++ /dev/null @@ -1 +0,0 @@ -0x38FFF diff --git a/test/082_allowednext_h48/06_empty_bound.in b/test/082_allowednext_h48/06_empty_bound.in deleted file mode 100644 index 389e262..0000000 --- a/test/082_allowednext_h48/06_empty_bound.in +++ /dev/null @@ -1,2 +0,0 @@ -2 -0 diff --git a/test/082_allowednext_h48/06_empty_bound.out b/test/082_allowednext_h48/06_empty_bound.out deleted file mode 100644 index eb601fc..0000000 --- a/test/082_allowednext_h48/06_empty_bound.out +++ /dev/null @@ -1 +0,0 @@ -0x2DB6D diff --git a/test/082_allowednext_h48/07_F_bound.in b/test/082_allowednext_h48/07_F_bound.in deleted file mode 100644 index b3ae33d..0000000 --- a/test/082_allowednext_h48/07_F_bound.in +++ /dev/null @@ -1,3 +0,0 @@ -2 -1 -F diff --git a/test/082_allowednext_h48/07_F_bound.out b/test/082_allowednext_h48/07_F_bound.out deleted file mode 100644 index 0dc8997..0000000 --- a/test/082_allowednext_h48/07_F_bound.out +++ /dev/null @@ -1 +0,0 @@ -0x28B6D diff --git a/test/082_allowednext_h48/08_U_D_bound_inverse.in b/test/082_allowednext_h48/08_U_D_bound_inverse.in deleted file mode 100644 index 707f7e0..0000000 --- a/test/082_allowednext_h48/08_U_D_bound_inverse.in +++ /dev/null @@ -1,4 +0,0 @@ -3 -2 -U -D2 \ No newline at end of file diff --git a/test/082_allowednext_h48/08_U_D_bound_inverse.out b/test/082_allowednext_h48/08_U_D_bound_inverse.out deleted file mode 100644 index 6f47cf0..0000000 --- a/test/082_allowednext_h48/08_U_D_bound_inverse.out +++ /dev/null @@ -1 +0,0 @@ -0x2DB40 diff --git a/test/082_allowednext_h48/09_R_false_bound.in b/test/082_allowednext_h48/09_R_false_bound.in deleted file mode 100644 index 0b1d441..0000000 --- a/test/082_allowednext_h48/09_R_false_bound.in +++ /dev/null @@ -1,3 +0,0 @@ -1 -1 -R \ No newline at end of file diff --git a/test/082_allowednext_h48/09_R_false_bound.out b/test/082_allowednext_h48/09_R_false_bound.out deleted file mode 100644 index 121bfeb..0000000 --- a/test/082_allowednext_h48/09_R_false_bound.out +++ /dev/null @@ -1 +0,0 @@ -0x3FE3F diff --git a/test/082_allowednext_h48/allowednext_h48_tests.c b/test/082_allowednext_h48/allowednext_h48_tests.c deleted file mode 100644 index 4cee695..0000000 --- a/test/082_allowednext_h48/allowednext_h48_tests.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "../test.h" - -uint32_t allowednextmoveH48(uint8_t *, uint8_t, uint32_t); - -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, bound; - - fgets(movestr, STRLENMAX, stdin); - bound = atoi(movestr); - - 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\n", - n > 1 ? moves[m[n-2]] : "-", - n > 0 ? moves[m[n-1]] : "-"); - uint32_t allowed = allowednextmoveH48(m, n, bound); - printf("0x%05X\n", allowed); -} diff --git a/test/130_allowednext_h48/00_empty_U.in b/test/130_allowednext_h48/00_empty_U.in new file mode 100644 index 0000000..28271a6 --- /dev/null +++ b/test/130_allowednext_h48/00_empty_U.in @@ -0,0 +1,3 @@ +0 +0 + diff --git a/test/130_allowednext_h48/00_empty_U.out b/test/130_allowednext_h48/00_empty_U.out new file mode 100644 index 0000000..8607955 --- /dev/null +++ b/test/130_allowednext_h48/00_empty_U.out @@ -0,0 +1 @@ +0x3FFFF diff --git a/test/130_allowednext_h48/01_F.in b/test/130_allowednext_h48/01_F.in new file mode 100644 index 0000000..e7ae375 --- /dev/null +++ b/test/130_allowednext_h48/01_F.in @@ -0,0 +1,4 @@ +0 +1 +F + diff --git a/test/130_allowednext_h48/01_F.out b/test/130_allowednext_h48/01_F.out new file mode 100644 index 0000000..5d6f843 --- /dev/null +++ b/test/130_allowednext_h48/01_F.out @@ -0,0 +1 @@ +0x38FFF diff --git a/test/130_allowednext_h48/02_U2.in b/test/130_allowednext_h48/02_U2.in new file mode 100644 index 0000000..2c5ee5f --- /dev/null +++ b/test/130_allowednext_h48/02_U2.in @@ -0,0 +1,3 @@ +0 +1 +U diff --git a/test/130_allowednext_h48/02_U2.out b/test/130_allowednext_h48/02_U2.out new file mode 100644 index 0000000..a9a5adb --- /dev/null +++ b/test/130_allowednext_h48/02_U2.out @@ -0,0 +1 @@ +0x3FFF8 diff --git a/test/130_allowednext_h48/03_R_L.in b/test/130_allowednext_h48/03_R_L.in new file mode 100644 index 0000000..b6c0625 --- /dev/null +++ b/test/130_allowednext_h48/03_R_L.in @@ -0,0 +1,5 @@ +0 +2 +R +L' + diff --git a/test/130_allowednext_h48/03_R_L.out b/test/130_allowednext_h48/03_R_L.out new file mode 100644 index 0000000..a4aa4b2 --- /dev/null +++ b/test/130_allowednext_h48/03_R_L.out @@ -0,0 +1 @@ +0x3F03F diff --git a/test/130_allowednext_h48/04_D.in b/test/130_allowednext_h48/04_D.in new file mode 100644 index 0000000..83da556 --- /dev/null +++ b/test/130_allowednext_h48/04_D.in @@ -0,0 +1,3 @@ +0 +1 +D diff --git a/test/130_allowednext_h48/04_D.out b/test/130_allowednext_h48/04_D.out new file mode 100644 index 0000000..fe91843 --- /dev/null +++ b/test/130_allowednext_h48/04_D.out @@ -0,0 +1 @@ +0x3FFC0 diff --git a/test/130_allowednext_h48/05_U_F_B2.in b/test/130_allowednext_h48/05_U_F_B2.in new file mode 100644 index 0000000..67e090f --- /dev/null +++ b/test/130_allowednext_h48/05_U_F_B2.in @@ -0,0 +1,5 @@ +0 +2 +U +F + diff --git a/test/130_allowednext_h48/05_U_F_B2.out b/test/130_allowednext_h48/05_U_F_B2.out new file mode 100644 index 0000000..5d6f843 --- /dev/null +++ b/test/130_allowednext_h48/05_U_F_B2.out @@ -0,0 +1 @@ +0x38FFF diff --git a/test/130_allowednext_h48/06_empty_bound.in b/test/130_allowednext_h48/06_empty_bound.in new file mode 100644 index 0000000..389e262 --- /dev/null +++ b/test/130_allowednext_h48/06_empty_bound.in @@ -0,0 +1,2 @@ +2 +0 diff --git a/test/130_allowednext_h48/06_empty_bound.out b/test/130_allowednext_h48/06_empty_bound.out new file mode 100644 index 0000000..eb601fc --- /dev/null +++ b/test/130_allowednext_h48/06_empty_bound.out @@ -0,0 +1 @@ +0x2DB6D diff --git a/test/130_allowednext_h48/07_F_bound.in b/test/130_allowednext_h48/07_F_bound.in new file mode 100644 index 0000000..b3ae33d --- /dev/null +++ b/test/130_allowednext_h48/07_F_bound.in @@ -0,0 +1,3 @@ +2 +1 +F diff --git a/test/130_allowednext_h48/07_F_bound.out b/test/130_allowednext_h48/07_F_bound.out new file mode 100644 index 0000000..0dc8997 --- /dev/null +++ b/test/130_allowednext_h48/07_F_bound.out @@ -0,0 +1 @@ +0x28B6D diff --git a/test/130_allowednext_h48/08_U_D_bound_inverse.in b/test/130_allowednext_h48/08_U_D_bound_inverse.in new file mode 100644 index 0000000..707f7e0 --- /dev/null +++ b/test/130_allowednext_h48/08_U_D_bound_inverse.in @@ -0,0 +1,4 @@ +3 +2 +U +D2 \ No newline at end of file diff --git a/test/130_allowednext_h48/08_U_D_bound_inverse.out b/test/130_allowednext_h48/08_U_D_bound_inverse.out new file mode 100644 index 0000000..6f47cf0 --- /dev/null +++ b/test/130_allowednext_h48/08_U_D_bound_inverse.out @@ -0,0 +1 @@ +0x2DB40 diff --git a/test/130_allowednext_h48/09_R_false_bound.in b/test/130_allowednext_h48/09_R_false_bound.in new file mode 100644 index 0000000..0b1d441 --- /dev/null +++ b/test/130_allowednext_h48/09_R_false_bound.in @@ -0,0 +1,3 @@ +1 +1 +R \ No newline at end of file diff --git a/test/130_allowednext_h48/09_R_false_bound.out b/test/130_allowednext_h48/09_R_false_bound.out new file mode 100644 index 0000000..121bfeb --- /dev/null +++ b/test/130_allowednext_h48/09_R_false_bound.out @@ -0,0 +1 @@ +0x3FE3F diff --git a/test/130_allowednext_h48/allowednext_h48_tests.c b/test/130_allowednext_h48/allowednext_h48_tests.c new file mode 100644 index 0000000..64ded35 --- /dev/null +++ b/test/130_allowednext_h48/allowednext_h48_tests.c @@ -0,0 +1,38 @@ +#include "../test.h" + +uint32_t allowednextmove_h48(uint8_t *, uint8_t, uint32_t); + +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, bound; + + fgets(movestr, STRLENMAX, stdin); + bound = atoi(movestr); + + 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\n", + n > 1 ? moves[m[n-2]] : "-", + n > 0 ? moves[m[n-1]] : "-"); + uint32_t allowed = allowednextmove_h48(m, n, bound); + printf("0x%05X\n", allowed); +} -- cgit v1.3