aboutsummaryrefslogtreecommitdiff
path: root/src/core/cube.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-04 12:15:37 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-04 12:15:37 +0200
commit0de1530f4cea21f2bc0a0e0f1cbf9da016c7bda5 (patch)
treea0a64424190588e5f734c257dd312e1f89fcd1eb /src/core/cube.h
parent80b065f757240af7920862b3e09f32a6dc06d392 (diff)
downloadnissy-core-0de1530f4cea21f2bc0a0e0f1cbf9da016c7bda5.tar.gz
nissy-core-0de1530f4cea21f2bc0a0e0f1cbf9da016c7bda5.zip
Revert table-based transformations
Long live the giant switch!
Diffstat (limited to 'src/core/cube.h')
-rw-r--r--src/core/cube.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/core/cube.h b/src/core/cube.h
index 560d113..2252a85 100644
--- a/src/core/cube.h
+++ b/src/core/cube.h
@@ -1,6 +1,5 @@
1STATIC cube_t solvecube(void); 1STATIC cube_t solvecube(void);
2STATIC_INLINE cube_t cubefromarray_ce(uint8_t [static 8], uint8_t [static 12]); 2STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]);
3STATIC_INLINE cube_t cubefromarray_single(uint8_t [static 20]);
4STATIC bool isconsistent(cube_t); 3STATIC bool isconsistent(cube_t);
5STATIC bool issolvable(cube_t); 4STATIC bool issolvable(cube_t);
6STATIC bool issolved(cube_t); 5STATIC bool issolved(cube_t);
@@ -15,23 +14,15 @@ solvedcube(void)
15 return SOLVED_CUBE; 14 return SOLVED_CUBE;
16} 15}
17 16
18STATIC_INLINE cube_t 17STATIC cube_t
19cubefromarray_ce(uint8_t c[static 8], uint8_t e[static 12]) 18cubefromarray(uint8_t c[static 8], uint8_t e[static 12])
20{ 19{
21 return cubefrompieces( 20 return STATIC_CUBE(
22 c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], 21 c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7],
23 e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], 22 e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7],
24 e[8], e[9], e[10], e[11]); 23 e[8], e[9], e[10], e[11]);
25} 24}
26 25
27STATIC_INLINE cube_t
28cubefromarray_single(uint8_t p[static 20])
29{
30 return cubefrompieces(
31 p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10],
32 p[11], p[12], p[13], p[14], p[15], p[16], p[17], p[18], p[19]);
33}
34
35STATIC bool 26STATIC bool
36isconsistent(cube_t cube) 27isconsistent(cube_t cube)
37{ 28{
@@ -187,5 +178,5 @@ getcube(int64_t ep, int64_t eo, int64_t cp, int64_t co)
187 for (i = 0; i < 8; i++) 178 for (i = 0; i < 8; i++)
188 carr[i] |= coarr[i] << COSHIFT; 179 carr[i] |= coarr[i] << COSHIFT;
189 180
190 return cubefromarray_ce(carr, earr); 181 return cubefromarray(carr, earr);
191} 182}

Generated with cgit - Back to sebastiano.tronto.net