diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-25 10:09:22 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-25 10:09:22 +0200 |
| commit | 7faca28009c5efb0ba2b897b34dbdcac47a1a6f3 (patch) | |
| tree | fd507509d00d2926175c72f4c06b9158c3a331a7 /test/051_compose_oriented | |
| parent | 17e5a9e1e2b241c67956651f87f40236467fe7d8 (diff) | |
| download | nissy-core-7faca28009c5efb0ba2b897b34dbdcac47a1a6f3.tar.gz nissy-core-7faca28009c5efb0ba2b897b34dbdcac47a1a6f3.zip | |
NISS
Diffstat (limited to 'test/051_compose_oriented')
| -rw-r--r-- | test/051_compose_oriented/00_scrambled_noorient.in | 4 | ||||
| -rw-r--r-- | test/051_compose_oriented/00_scrambled_noorient.out | 1 | ||||
| -rw-r--r-- | test/051_compose_oriented/01_Uw_Fw.in | 2 | ||||
| -rw-r--r-- | test/051_compose_oriented/01_Uw_Fw.out | 1 | ||||
| -rw-r--r-- | test/051_compose_oriented/02_scrambled_scrambled.in | 4 | ||||
| -rw-r--r-- | test/051_compose_oriented/02_scrambled_scrambled.out | 1 | ||||
| -rw-r--r-- | test/051_compose_oriented/compose_oriented_tests.c | 24 |
7 files changed, 37 insertions, 0 deletions
diff --git a/test/051_compose_oriented/00_scrambled_noorient.in b/test/051_compose_oriented/00_scrambled_noorient.in new file mode 100644 index 0000000..904292f --- /dev/null +++ b/test/051_compose_oriented/00_scrambled_noorient.in | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | CILVXGMR=FKbGIDSXBJAU=A | ||
| 2 | JLQWSVUH=ZLCUABGIVTKH=A | ||
| 3 | // Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B' | ||
| 4 | // Followed by R' U' F | ||
diff --git a/test/051_compose_oriented/00_scrambled_noorient.out b/test/051_compose_oriented/00_scrambled_noorient.out new file mode 100644 index 0000000..426e4fe --- /dev/null +++ b/test/051_compose_oriented/00_scrambled_noorient.out | |||
| @@ -0,0 +1 @@ | |||
| QFSEDWPR=ZUbYFKSBTWAX=A | |||
diff --git a/test/051_compose_oriented/01_Uw_Fw.in b/test/051_compose_oriented/01_Uw_Fw.in new file mode 100644 index 0000000..d50425a --- /dev/null +++ b/test/051_compose_oriented/01_Uw_Fw.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | ABHGEFCD=ABHGEFCDIJKL=B | ||
| 2 | AXUDJFGK=ABCDEKJHIFGL=Q | ||
diff --git a/test/051_compose_oriented/01_Uw_Fw.out b/test/051_compose_oriented/01_Uw_Fw.out new file mode 100644 index 0000000..5b15c06 --- /dev/null +++ b/test/051_compose_oriented/01_Uw_Fw.out | |||
| @@ -0,0 +1 @@ | |||
| MBKGXFQD=ZBHYEFCDQWKL=J | |||
diff --git a/test/051_compose_oriented/02_scrambled_scrambled.in b/test/051_compose_oriented/02_scrambled_scrambled.in new file mode 100644 index 0000000..5b814bc --- /dev/null +++ b/test/051_compose_oriented/02_scrambled_scrambled.in | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | JHFGDMQS=ZaUGRCFHQbTY=W | ||
| 2 | DCNORMXQ=YbaDFECXWRJA=G | ||
| 3 | // First cube: "F R Uw Lw' D E2 x y M" | ||
| 4 | // Second cube: "x R U R' Fw2 Bw y' S3" | ||
diff --git a/test/051_compose_oriented/02_scrambled_scrambled.out b/test/051_compose_oriented/02_scrambled_scrambled.out new file mode 100644 index 0000000..e6a0684 --- /dev/null +++ b/test/051_compose_oriented/02_scrambled_scrambled.out | |||
| @@ -0,0 +1 @@ | |||
| VSMPGQJD=ZRHFLUCKAWYT=Q | |||
diff --git a/test/051_compose_oriented/compose_oriented_tests.c b/test/051_compose_oriented/compose_oriented_tests.c new file mode 100644 index 0000000..f677dd6 --- /dev/null +++ b/test/051_compose_oriented/compose_oriented_tests.c | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | oriented_cube_t compose_oriented(oriented_cube_t, oriented_cube_t); | ||
| 4 | |||
| 5 | void run(void) { | ||
| 6 | char str[STRLENMAX]; | ||
| 7 | oriented_cube_t c1, c2, c3; | ||
| 8 | |||
| 9 | fgets(str, STRLENMAX, stdin); | ||
| 10 | c1 = readcube(str); | ||
| 11 | fgets(str, STRLENMAX, stdin); | ||
| 12 | c2 = readcube(str); | ||
| 13 | |||
| 14 | c3 = compose_oriented(c1, c2); | ||
| 15 | |||
| 16 | if (iserror(c3)) { | ||
| 17 | printf("Error composing cubes\n"); | ||
| 18 | } else if (!issolvable(c3)) { | ||
| 19 | printf("Composed cube is not solvable\n"); | ||
| 20 | } else { | ||
| 21 | writecube(c3, NISSY_SIZE_CUBE, str); | ||
| 22 | printf("%s\n", str); | ||
| 23 | } | ||
| 24 | } | ||
