aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-23 15:42:11 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-23 15:42:11 +0200
commit9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0 (patch)
treee590922e2bd34cb802cef96c1c8d8ba935da4f75 /src/core
parent039267a278bb9e0580e8aebd85ef5f3ed774688f (diff)
downloadnissy-core-9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0.tar.gz
nissy-core-9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0.zip
Added orientation to getcube
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cube.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/cube.h b/src/core/cube.h
index 91bb284..88e1ca9 100644
--- a/src/core/cube.h
+++ b/src/core/cube.h
@@ -4,7 +4,8 @@ STATIC bool isconsistent(oriented_cube_t);
4STATIC bool issolvable(oriented_cube_t); 4STATIC bool issolvable(oriented_cube_t);
5STATIC bool issolved(oriented_cube_t); 5STATIC bool issolved(oriented_cube_t);
6STATIC bool iserror(oriented_cube_t); 6STATIC bool iserror(oriented_cube_t);
7STATIC void getcube_fix(long long *, long long *, long long *, long long *); 7STATIC void getcube_fix(long long *, long long *,
8 long long *, long long *, long long *);
8STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t); 9STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t);
9 10
10STATIC oriented_cube_t readcube(const char *); 11STATIC oriented_cube_t readcube(const char *);
@@ -148,7 +149,13 @@ iserror(oriented_cube_t cube)
148} 149}
149 150
150STATIC void 151STATIC void
151getcube_fix(long long *ep, long long *eo, long long *cp, long long *co) 152getcube_fix(
153 long long *ep,
154 long long *eo,
155 long long *cp,
156 long long *co,
157 long long *orien
158)
152{ 159{
153 uint8_t e[12], c[8], coarr[8]; 160 uint8_t e[12], c[8], coarr[8];
154 161
@@ -156,6 +163,7 @@ getcube_fix(long long *ep, long long *eo, long long *cp, long long *co)
156 *eo = (*eo % POW_2_11 + POW_2_11) % POW_2_11; 163 *eo = (*eo % POW_2_11 + POW_2_11) % POW_2_11;
157 *cp = (*cp % FACT_8 + FACT_8) % FACT_8; 164 *cp = (*cp % FACT_8 + FACT_8) % FACT_8;
158 *co = (*cp % POW_3_7 + POW_3_7) % POW_3_7; 165 *co = (*cp % POW_3_7 + POW_3_7) % POW_3_7;
166 *orien = (*orien % 24 + 24) % 24;
159 167
160 indextoperm(*ep, 12, e); 168 indextoperm(*ep, 12, e);
161 indextoperm(*cp, 8, c); 169 indextoperm(*cp, 8, c);

Generated with cgit - Back to sebastiano.tronto.net