diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-03 21:52:16 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-03 21:52:16 +0200 |
| commit | c9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8 (patch) | |
| tree | f4f569fcbd4d6704fb5dd44892911ce808f03332 /test/082_allowednext_h48/allowednext_h48_tests.c | |
| parent | ff4bde84872ec0b93f0f097f5a56bd5e7cbb0311 (diff) | |
| download | nissy-core-c9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8.tar.gz nissy-core-c9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8.zip | |
Moved stuff around
Diffstat (limited to 'test/082_allowednext_h48/allowednext_h48_tests.c')
| -rw-r--r-- | test/082_allowednext_h48/allowednext_h48_tests.c | 38 |
1 files changed, 0 insertions, 38 deletions
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 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | uint32_t allowednextmoveH48(uint8_t *, uint8_t, uint32_t); | ||
| 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, bound; | ||
| 18 | |||
| 19 | fgets(movestr, STRLENMAX, stdin); | ||
| 20 | bound = atoi(movestr); | ||
| 21 | |||
| 22 | fgets(movestr, STRLENMAX, stdin); | ||
| 23 | n = atoi(movestr); | ||
| 24 | |||
| 25 | for (i = 0; i < n; i++) { | ||
| 26 | fgets(movestr, STRLENMAX, stdin); | ||
| 27 | movestr[strcspn(movestr, "\n")] = 0; | ||
| 28 | for (j = 0; j < 18; j++) | ||
| 29 | if (!strcmp(movestr, moves[j])) | ||
| 30 | m[i] = j; | ||
| 31 | } | ||
| 32 | |||
| 33 | fprintf(stderr, "Last two: %s, %s\n", | ||
| 34 | n > 1 ? moves[m[n-2]] : "-", | ||
| 35 | n > 0 ? moves[m[n-1]] : "-"); | ||
| 36 | uint32_t allowed = allowednextmoveH48(m, n, bound); | ||
| 37 | printf("0x%05X\n", allowed); | ||
| 38 | } | ||
