aboutsummaryrefslogtreecommitdiff
path: root/test/051_compose_oriented
diff options
context:
space:
mode:
Diffstat (limited to 'test/051_compose_oriented')
-rw-r--r--test/051_compose_oriented/00_scrambled_noorient.in4
-rw-r--r--test/051_compose_oriented/00_scrambled_noorient.out1
-rw-r--r--test/051_compose_oriented/01_Uw_Fw.in2
-rw-r--r--test/051_compose_oriented/01_Uw_Fw.out1
-rw-r--r--test/051_compose_oriented/02_scrambled_scrambled.in4
-rw-r--r--test/051_compose_oriented/02_scrambled_scrambled.out1
-rw-r--r--test/051_compose_oriented/compose_oriented_tests.c24
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 @@
1CILVXGMR=FKbGIDSXBJAU=A
2JLQWSVUH=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 @@
1ABHGEFCD=ABHGEFCDIJKL=B
2AXUDJFGK=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 @@
1JHFGDMQS=ZaUGRCFHQbTY=W
2DCNORMXQ=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
3oriented_cube_t compose_oriented(oriented_cube_t, oriented_cube_t);
4
5void 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}

Generated with cgit - Back to sebastiano.tronto.net