diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-28 15:42:26 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-28 15:42:26 +0200 |
| commit | 28ad019d62583b7e89b4e76922aa73857d5876eb (patch) | |
| tree | 1a103ea701eb013785f1d0fa45f450d6a16b6d78 /test/001_pieces/pieces_tests.c | |
| parent | 49b9c4a516f72e03d53277075f4580e2df8f0e63 (diff) | |
| download | nissy-core-28ad019d62583b7e89b4e76922aa73857d5876eb.tar.gz nissy-core-28ad019d62583b7e89b4e76922aa73857d5876eb.zip | |
Added roadmap for refactor and some simple routines
Diffstat (limited to 'test/001_pieces/pieces_tests.c')
| -rw-r--r-- | test/001_pieces/pieces_tests.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/001_pieces/pieces_tests.c b/test/001_pieces/pieces_tests.c new file mode 100644 index 0000000..f3d8d4e --- /dev/null +++ b/test/001_pieces/pieces_tests.c | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | uint8_t corner(cube_fast_t, int); | ||
| 4 | uint8_t edge(cube_fast_t, int); | ||
| 5 | |||
| 6 | int main(void) { | ||
| 7 | int i; | ||
| 8 | char str[STRLENMAX], *aux; | ||
| 9 | cube_t cube; | ||
| 10 | cube_fast_t fast; | ||
| 11 | |||
| 12 | aux = str; | ||
| 13 | while (fgets(aux, STRLENMAX, stdin) != NULL) | ||
| 14 | while (*aux != '\n') | ||
| 15 | aux++; | ||
| 16 | |||
| 17 | cube = readcube("H48", str); | ||
| 18 | fast = cubetofast(cube); | ||
| 19 | |||
| 20 | for (i = 0; i < 8; i++) | ||
| 21 | printf("%" PRIu8 " ", corner(fast, i)); | ||
| 22 | printf("\n"); | ||
| 23 | for (i = 0; i < 12; i++) | ||
| 24 | printf("%" PRIu8 " ", edge(fast, i)); | ||
| 25 | printf("\n"); | ||
| 26 | |||
| 27 | return 0; | ||
| 28 | } | ||
