diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:18:45 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:18:45 +0100 |
| commit | e0f38c7e42d9e48ac654f9dcedf8722ff1136106 (patch) | |
| tree | fc92f1dc8d0ade82541d216e05ba37b3ddc97ca3 /test/040_inverse_cube | |
| parent | ad9bdca9741b5f038610cbe0536131ab0dc7b511 (diff) | |
| download | nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.tar.gz nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.zip | |
Renamed tests, added tests for permsign
Diffstat (limited to 'test/040_inverse_cube')
| -rw-r--r-- | test/040_inverse_cube/00_solved.in | 1 | ||||
| -rw-r--r-- | test/040_inverse_cube/00_solved.out | 1 | ||||
| -rw-r--r-- | test/040_inverse_cube/01_scrambled.in | 1 | ||||
| -rw-r--r-- | test/040_inverse_cube/01_scrambled.out | 1 | ||||
| -rw-r--r-- | test/040_inverse_cube/inverse_tests.c | 23 |
5 files changed, 27 insertions, 0 deletions
diff --git a/test/040_inverse_cube/00_solved.in b/test/040_inverse_cube/00_solved.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/040_inverse_cube/00_solved.in | |||
| @@ -0,0 +1 @@ | |||
| UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 | |||
diff --git a/test/040_inverse_cube/00_solved.out b/test/040_inverse_cube/00_solved.out new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/040_inverse_cube/00_solved.out | |||
| @@ -0,0 +1 @@ | |||
| UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 | |||
diff --git a/test/040_inverse_cube/01_scrambled.in b/test/040_inverse_cube/01_scrambled.in new file mode 100644 index 0000000..263213b --- /dev/null +++ b/test/040_inverse_cube/01_scrambled.in | |||
| @@ -0,0 +1 @@ | |||
| DR0 DB0 BL0 DF1 UB0 UR1 FR1 UF0 FL1 DL0 BR1 UL1 DBL2 DFL0 UBR1 DFR2 UFR0 DBR1 UBL0 UFL0 | |||
diff --git a/test/040_inverse_cube/01_scrambled.out b/test/040_inverse_cube/01_scrambled.out new file mode 100644 index 0000000..25089c6 --- /dev/null +++ b/test/040_inverse_cube/01_scrambled.out | |||
| @@ -0,0 +1 @@ | |||
| DR0 UR0 UB0 DF1 UL1 BR1 FL0 UF0 DL1 FR1 DB0 BL1 UFL0 DFR0 UBL0 UBR2 DBL0 DFL2 DBR1 UFR1 | |||
diff --git a/test/040_inverse_cube/inverse_tests.c b/test/040_inverse_cube/inverse_tests.c new file mode 100644 index 0000000..d6d47ba --- /dev/null +++ b/test/040_inverse_cube/inverse_tests.c | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | cube_t inverse(cube_t); | ||
| 4 | |||
| 5 | int main() { | ||
| 6 | char str[STRLENMAX]; | ||
| 7 | cube_t cube, inv; | ||
| 8 | |||
| 9 | fgets(str, STRLENMAX, stdin); | ||
| 10 | cube = readcube("H48", str); | ||
| 11 | inv = inverse(cube); | ||
| 12 | |||
| 13 | if (iserror(inv)) { | ||
| 14 | printf("Error inverting cube\n"); | ||
| 15 | } else if (!issolvable(inv)) { | ||
| 16 | printf("Inverted cube is not solvable\n"); | ||
| 17 | } else { | ||
| 18 | writecube("H48", inv, str); | ||
| 19 | printf("%s\n", str); | ||
| 20 | } | ||
| 21 | |||
| 22 | return 0; | ||
| 23 | } | ||
