diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-23 15:42:11 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-23 15:42:11 +0200 |
| commit | 9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0 (patch) | |
| tree | e590922e2bd34cb802cef96c1c8d8ba935da4f75 /src/core | |
| parent | 039267a278bb9e0580e8aebd85ef5f3ed774688f (diff) | |
| download | nissy-core-9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0.tar.gz nissy-core-9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0.zip | |
Added orientation to getcube
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/cube.h | 12 |
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); | |||
| 4 | STATIC bool issolvable(oriented_cube_t); | 4 | STATIC bool issolvable(oriented_cube_t); |
| 5 | STATIC bool issolved(oriented_cube_t); | 5 | STATIC bool issolved(oriented_cube_t); |
| 6 | STATIC bool iserror(oriented_cube_t); | 6 | STATIC bool iserror(oriented_cube_t); |
| 7 | STATIC void getcube_fix(long long *, long long *, long long *, long long *); | 7 | STATIC void getcube_fix(long long *, long long *, |
| 8 | long long *, long long *, long long *); | ||
| 8 | STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t); | 9 | STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t); |
| 9 | 10 | ||
| 10 | STATIC oriented_cube_t readcube(const char *); | 11 | STATIC oriented_cube_t readcube(const char *); |
| @@ -148,7 +149,13 @@ iserror(oriented_cube_t cube) | |||
| 148 | } | 149 | } |
| 149 | 150 | ||
| 150 | STATIC void | 151 | STATIC void |
| 151 | getcube_fix(long long *ep, long long *eo, long long *cp, long long *co) | 152 | getcube_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); |
