diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:54:44 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:54:44 +0200 |
| commit | 270e5b0444f67781856bf80db51650af9cb89b0c (patch) | |
| tree | 1f895ca8fdbf256dcdf550dd0a28ca99993efc08 /test/080_allowedmoves/allowedmoves_tests.c | |
| parent | 2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062 (diff) | |
| download | nissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.tar.gz nissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.zip | |
Renamed tests to make space for more coordinate tests
Diffstat (limited to 'test/080_allowedmoves/allowedmoves_tests.c')
| -rw-r--r-- | test/080_allowedmoves/allowedmoves_tests.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/test/080_allowedmoves/allowedmoves_tests.c b/test/080_allowedmoves/allowedmoves_tests.c deleted file mode 100644 index aa6bda7..0000000 --- a/test/080_allowedmoves/allowedmoves_tests.c +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | bool allowedmoves(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 | printf("%s\n", allowedmoves(n, m) ? "true" : "false"); | ||
| 31 | } | ||
