aboutsummaryrefslogtreecommitdiff
path: root/test/075_set_eo
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-05-17 17:42:43 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-05-17 17:42:43 +0200
commit1809d7b212128fcdcb481002a17db5dc97a15e03 (patch)
tree4e045b4fefc5e229969891b0e1963dd683bd46ad /test/075_set_eo
parentd26d9e46d305b3ab3c6ae3b55f1859cf413a1c94 (diff)
downloadnissy-core-1809d7b212128fcdcb481002a17db5dc97a15e03.tar.gz
nissy-core-1809d7b212128fcdcb481002a17db5dc97a15e03.zip
Added inverse eo and copy_{edges,corners}
Diffstat (limited to 'test/075_set_eo')
-rw-r--r--test/075_set_eo/00_solved_0.in2
-rw-r--r--test/075_set_eo/00_solved_0.out1
-rw-r--r--test/075_set_eo/01_solved_1.in2
-rw-r--r--test/075_set_eo/01_solved_1.out1
-rw-r--r--test/075_set_eo/02_solved_other.in2
-rw-r--r--test/075_set_eo/02_solved_other.out1
-rw-r--r--test/075_set_eo/03_solved_firstlast.in2
-rw-r--r--test/075_set_eo/03_solved_firstlast.out1
-rw-r--r--test/075_set_eo/10_scrambled_0.in4
-rw-r--r--test/075_set_eo/10_scrambled_0.out1
-rw-r--r--test/075_set_eo/11_scrambled_1.in4
-rw-r--r--test/075_set_eo/11_scrambled_1.out1
-rw-r--r--test/075_set_eo/set_eo_tests.c38
13 files changed, 60 insertions, 0 deletions
diff --git a/test/075_set_eo/00_solved_0.in b/test/075_set_eo/00_solved_0.in
new file mode 100644
index 0000000..55bb6bf
--- /dev/null
+++ b/test/075_set_eo/00_solved_0.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
20
diff --git a/test/075_set_eo/00_solved_0.out b/test/075_set_eo/00_solved_0.out
new file mode 100644
index 0000000..dff224d
--- /dev/null
+++ b/test/075_set_eo/00_solved_0.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/075_set_eo/01_solved_1.in b/test/075_set_eo/01_solved_1.in
new file mode 100644
index 0000000..edd864e
--- /dev/null
+++ b/test/075_set_eo/01_solved_1.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
22047
diff --git a/test/075_set_eo/01_solved_1.out b/test/075_set_eo/01_solved_1.out
new file mode 100644
index 0000000..ec7594a
--- /dev/null
+++ b/test/075_set_eo/01_solved_1.out
@@ -0,0 +1 @@
UF1 UB1 DB1 DF1 UR1 UL1 DL1 DR1 FR1 FL1 BL1 BR1 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/075_set_eo/02_solved_other.in b/test/075_set_eo/02_solved_other.in
new file mode 100644
index 0000000..17e9b02
--- /dev/null
+++ b/test/075_set_eo/02_solved_other.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
220
diff --git a/test/075_set_eo/02_solved_other.out b/test/075_set_eo/02_solved_other.out
new file mode 100644
index 0000000..df73ef8
--- /dev/null
+++ b/test/075_set_eo/02_solved_other.out
@@ -0,0 +1 @@
UF0 UB0 DB0 DF1 UR0 UL1 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/075_set_eo/03_solved_firstlast.in b/test/075_set_eo/03_solved_firstlast.in
new file mode 100644
index 0000000..a16a192
--- /dev/null
+++ b/test/075_set_eo/03_solved_firstlast.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
21024
diff --git a/test/075_set_eo/03_solved_firstlast.out b/test/075_set_eo/03_solved_firstlast.out
new file mode 100644
index 0000000..8679be3
--- /dev/null
+++ b/test/075_set_eo/03_solved_firstlast.out
@@ -0,0 +1 @@
UF1 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR1 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/075_set_eo/10_scrambled_0.in b/test/075_set_eo/10_scrambled_0.in
new file mode 100644
index 0000000..55dccca
--- /dev/null
+++ b/test/075_set_eo/10_scrambled_0.in
@@ -0,0 +1,4 @@
1UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
20
3
4// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B'
diff --git a/test/075_set_eo/10_scrambled_0.out b/test/075_set_eo/10_scrambled_0.out
new file mode 100644
index 0000000..0eabd6e
--- /dev/null
+++ b/test/075_set_eo/10_scrambled_0.out
@@ -0,0 +1 @@
UL0 BL0 BR0 DL0 FR0 DF0 DB0 DR0 UB0 FL0 UF0 UR0 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/075_set_eo/11_scrambled_1.in b/test/075_set_eo/11_scrambled_1.in
new file mode 100644
index 0000000..0037a04
--- /dev/null
+++ b/test/075_set_eo/11_scrambled_1.in
@@ -0,0 +1,4 @@
1UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
22047
3
4// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B'
diff --git a/test/075_set_eo/11_scrambled_1.out b/test/075_set_eo/11_scrambled_1.out
new file mode 100644
index 0000000..843df0d
--- /dev/null
+++ b/test/075_set_eo/11_scrambled_1.out
@@ -0,0 +1 @@
UL1 BL1 BR1 DL1 FR1 DF1 DB1 DR1 UB1 FL1 UF1 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/075_set_eo/set_eo_tests.c b/test/075_set_eo/set_eo_tests.c
new file mode 100644
index 0000000..ef7215a
--- /dev/null
+++ b/test/075_set_eo/set_eo_tests.c
@@ -0,0 +1,38 @@
1#include "../test.h"
2
3int64_t coord_fast_eo(cube_fast_t);
4void set_eo_fast(cube_fast_t *, int64_t);
5cube_fast_t cubetofast(cube_t);
6cube_t fasttocube(cube_fast_t);
7
8int main(void) {
9 char str[STRLENMAX];
10 cube_t cube;
11 cube_fast_t fast;
12 int64_t eo;
13
14 fgets(str, STRLENMAX, stdin);
15 cube = readcube("H48", str);
16 fast = cubetofast(cube);
17 fgets(str, STRLENMAX, stdin);
18 eo = atoi(str);
19
20 set_eo_fast(&fast, eo);
21
22 cube = fasttocube(fast);
23 if (iserror(cube)) {
24 printf("Error setting EO\n");
25 } else if (!isconsistent(cube)) {
26 fprintf(stderr, "edges: ");
27 for (int i = 0; i < 12; i++) fprintf(stderr, "%d ", cube.edge[i]);
28 fprintf(stderr, "\n");
29 for (int i = 0; i < 8; i++) fprintf(stderr, "%d ", cube.corner[i]);
30 fprintf(stderr, "\n");
31 printf("Setting EO resulted in inconsistent cube\n");
32 } else {
33 writecube("H48", cube, str);
34 printf("%s\n", str);
35 }
36
37 return 0;
38}

Generated with cgit - Back to sebastiano.tronto.net