diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-03-30 18:40:02 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-03-30 18:40:02 +0100 |
| commit | c14e780551c4e7aa88d99b226b12f7cdd7b92527 (patch) | |
| tree | df663976f093b6446d8470c078bc105a541a9857 /test/061_inverse_trans | |
| parent | ec564e62dcfe701b5ee3111b92c7d72ffd0dda6c (diff) | |
| download | nissy-core-c14e780551c4e7aa88d99b226b12f7cdd7b92527.tar.gz nissy-core-c14e780551c4e7aa88d99b226b12f7cdd7b92527.zip | |
Added cocsep data generation, but it is very slow
Diffstat (limited to 'test/061_inverse_trans')
| -rw-r--r-- | test/061_inverse_trans/00_all.in | 0 | ||||
| -rw-r--r-- | test/061_inverse_trans/00_all.out | 0 | ||||
| -rw-r--r-- | test/061_inverse_trans/inverse_trans_tests.c | 38 |
3 files changed, 38 insertions, 0 deletions
diff --git a/test/061_inverse_trans/00_all.in b/test/061_inverse_trans/00_all.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/061_inverse_trans/00_all.in | |||
diff --git a/test/061_inverse_trans/00_all.out b/test/061_inverse_trans/00_all.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/061_inverse_trans/00_all.out | |||
diff --git a/test/061_inverse_trans/inverse_trans_tests.c b/test/061_inverse_trans/inverse_trans_tests.c new file mode 100644 index 0000000..77bd40b --- /dev/null +++ b/test/061_inverse_trans/inverse_trans_tests.c | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | uint8_t readtrans(char *); | ||
| 4 | uint8_t inverse_trans(uint8_t); | ||
| 5 | cube_t applymoves(cube_t, char *); | ||
| 6 | cube_t applytrans(cube_t, char *); | ||
| 7 | extern char *transstr[]; | ||
| 8 | |||
| 9 | int main(void) { | ||
| 10 | uint8_t t, tinv; | ||
| 11 | cube_t cube; | ||
| 12 | |||
| 13 | for (t = 0; t < 48; t++) { | ||
| 14 | cube = solvedcube(); | ||
| 15 | cube = applymoves(cube, "R"); | ||
| 16 | cube = applymoves(cube, "U"); | ||
| 17 | cube = applymoves(cube, "F"); | ||
| 18 | |||
| 19 | cube = applytrans(cube, transstr[t]); | ||
| 20 | tinv = inverse_trans(t); | ||
| 21 | cube = applytrans(cube, transstr[tinv]); | ||
| 22 | |||
| 23 | if (iserror(cube)) { | ||
| 24 | printf("Error transforming cube\n"); | ||
| 25 | } else if (!issolvable(cube)) { | ||
| 26 | printf("Transformed cube is not solvable\n"); | ||
| 27 | } else { | ||
| 28 | cube = applymoves(cube, "F'"); | ||
| 29 | cube = applymoves(cube, "U'"); | ||
| 30 | cube = applymoves(cube, "R'"); | ||
| 31 | if (!issolved(cube)) | ||
| 32 | printf("%s: Error! Got %" PRIu8 "\n", | ||
| 33 | transstr[t], tinv); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 37 | return 0; | ||
| 38 | } | ||
