diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-01 09:33:26 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-01 09:33:26 +0200 |
| commit | b0053277e385bee23336d1fe6b69a12f49f9172f (patch) | |
| tree | 531e44cd6f8e807c991d0a46692140667939fbe3 /test/080_allowednext | |
| parent | b6c1ff6cfdfe0f4ce602fe83e54c3112a1c95690 (diff) | |
| download | nissy-core-b0053277e385bee23336d1fe6b69a12f49f9172f.tar.gz nissy-core-b0053277e385bee23336d1fe6b69a12f49f9172f.zip | |
simplified allowedmoves logic
Diffstat (limited to 'test/080_allowednext')
| -rw-r--r-- | test/080_allowednext/00_empty_U.in | 2 | ||||
| -rw-r--r-- | test/080_allowednext/00_empty_U.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/01_F_F2.in | 3 | ||||
| -rw-r--r-- | test/080_allowednext/01_F_F2.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/02_U_F.in | 3 | ||||
| -rw-r--r-- | test/080_allowednext/02_U_F.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/03_R_L_R.in | 4 | ||||
| -rw-r--r-- | test/080_allowednext/03_R_L_R.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/04_longer_true.in | 12 | ||||
| -rw-r--r-- | test/080_allowednext/04_longer_true.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/05_longer_false.in | 9 | ||||
| -rw-r--r-- | test/080_allowednext/05_longer_false.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/06_D_U_false_order.in | 3 | ||||
| -rw-r--r-- | test/080_allowednext/06_D_U_false_order.out | 1 | ||||
| -rw-r--r-- | test/080_allowednext/allowednext_tests.c | 35 |
15 files changed, 0 insertions, 78 deletions
diff --git a/test/080_allowednext/00_empty_U.in b/test/080_allowednext/00_empty_U.in deleted file mode 100644 index feb4bc3..0000000 --- a/test/080_allowednext/00_empty_U.in +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | 0 | ||
| 2 | U | ||
diff --git a/test/080_allowednext/00_empty_U.out b/test/080_allowednext/00_empty_U.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowednext/00_empty_U.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | true | ||
diff --git a/test/080_allowednext/01_F_F2.in b/test/080_allowednext/01_F_F2.in deleted file mode 100644 index 93f0a9c..0000000 --- a/test/080_allowednext/01_F_F2.in +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | 2 | ||
| 2 | F | ||
| 3 | F2 | ||
diff --git a/test/080_allowednext/01_F_F2.out b/test/080_allowednext/01_F_F2.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowednext/01_F_F2.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | false | ||
diff --git a/test/080_allowednext/02_U_F.in b/test/080_allowednext/02_U_F.in deleted file mode 100644 index ad3607e..0000000 --- a/test/080_allowednext/02_U_F.in +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | 2 | ||
| 2 | U | ||
| 3 | F | ||
diff --git a/test/080_allowednext/02_U_F.out b/test/080_allowednext/02_U_F.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowednext/02_U_F.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | true | ||
diff --git a/test/080_allowednext/03_R_L_R.in b/test/080_allowednext/03_R_L_R.in deleted file mode 100644 index ffd9542..0000000 --- a/test/080_allowednext/03_R_L_R.in +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | 3 | ||
| 2 | R | ||
| 3 | L' | ||
| 4 | R2 | ||
diff --git a/test/080_allowednext/03_R_L_R.out b/test/080_allowednext/03_R_L_R.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowednext/03_R_L_R.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | false | ||
diff --git a/test/080_allowednext/04_longer_true.in b/test/080_allowednext/04_longer_true.in deleted file mode 100644 index 0360619..0000000 --- a/test/080_allowednext/04_longer_true.in +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | 11 | ||
| 2 | F2 | ||
| 3 | B | ||
| 4 | D2 | ||
| 5 | D' | ||
| 6 | L | ||
| 7 | R2 | ||
| 8 | U | ||
| 9 | U' | ||
| 10 | D | ||
| 11 | F | ||
| 12 | L | ||
diff --git a/test/080_allowednext/04_longer_true.out b/test/080_allowednext/04_longer_true.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowednext/04_longer_true.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | true | ||
diff --git a/test/080_allowednext/05_longer_false.in b/test/080_allowednext/05_longer_false.in deleted file mode 100644 index 6cf8ecd..0000000 --- a/test/080_allowednext/05_longer_false.in +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | 8 | ||
| 2 | D | ||
| 3 | B2 | ||
| 4 | F' | ||
| 5 | L' | ||
| 6 | F' | ||
| 7 | L' | ||
| 8 | R2 | ||
| 9 | L | ||
diff --git a/test/080_allowednext/05_longer_false.out b/test/080_allowednext/05_longer_false.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowednext/05_longer_false.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | false | ||
diff --git a/test/080_allowednext/06_D_U_false_order.in b/test/080_allowednext/06_D_U_false_order.in deleted file mode 100644 index 680d1a1..0000000 --- a/test/080_allowednext/06_D_U_false_order.in +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | 2 | ||
| 2 | D | ||
| 3 | U | ||
diff --git a/test/080_allowednext/06_D_U_false_order.out b/test/080_allowednext/06_D_U_false_order.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowednext/06_D_U_false_order.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | false | ||
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 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | bool allowednextmove(size_t n, const uint8_t [n]); | ||
| 4 | |||
| 5 | static char *moves[] = { | ||
| 6 | "U", "U2", "U'", | ||
| 7 | "D", "D2", "D'", | ||
| 8 | "R", "R2", "R'", | ||
| 9 | "L", "L2", "L'", | ||
| 10 | "F", "F2", "F'", | ||
| 11 | "B", "B2", "B'", | ||
| 12 | }; | ||
| 13 | |||
| 14 | void run(void) { | ||
| 15 | char movestr[STRLENMAX]; | ||
| 16 | uint8_t m[100]; | ||
| 17 | int n, i, j; | ||
| 18 | |||
| 19 | fgets(movestr, STRLENMAX, stdin); | ||
| 20 | n = atoi(movestr); | ||
| 21 | |||
| 22 | for (i = 0; i < n; i++) { | ||
| 23 | fgets(movestr, STRLENMAX, stdin); | ||
| 24 | movestr[strcspn(movestr, "\n")] = 0; | ||
| 25 | for (j = 0; j < 18; j++) | ||
| 26 | if (!strcmp(movestr, moves[j])) | ||
| 27 | m[i] = j; | ||
| 28 | } | ||
| 29 | |||
| 30 | fprintf(stderr, "Last two: %s, %s\nNext: %s\n", | ||
| 31 | n > 2 ? moves[m[n-3]] : "-", | ||
| 32 | n > 1 ? moves[m[n-2]] : "-", | ||
| 33 | n > 0 ? moves[m[n-1]] : "-"); | ||
| 34 | printf("%s\n", allowednextmove(n, m) ? "true" : "false"); | ||
| 35 | } | ||
