diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-30 17:52:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-30 17:52:55 +0200 |
| commit | ff4bde84872ec0b93f0f097f5a56bd5e7cbb0311 (patch) | |
| tree | 2c5faddf404ebd92bd1b1039dd0c8a779de4fc58 /src/core/cube.h | |
| parent | eb20084ec94e9043e55a98717128a4ba1e6215cb (diff) | |
| parent | 4abb800c4b4f3a509c07821ade8d34e3699bdf10 (diff) | |
| download | nissy-core-ff4bde84872ec0b93f0f097f5a56bd5e7cbb0311.tar.gz nissy-core-ff4bde84872ec0b93f0f097f5a56bd5e7cbb0311.zip | |
Merge pull request #2 from enricotenuti/master
nissbranch ver1
Diffstat (limited to '')
| -rw-r--r-- | src/core/cube.h | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/src/core/cube.h b/src/core/cube.h index fe36f90..4b28103 100644 --- a/src/core/cube.h +++ b/src/core/cube.h | |||
| @@ -13,11 +13,13 @@ _static cube_t frommoves(const char *); | |||
| 13 | _static void getcube_fix(int64_t *, int64_t *, int64_t *, int64_t *); | 13 | _static void getcube_fix(int64_t *, int64_t *, int64_t *, int64_t *); |
| 14 | _static cube_t getcube(int64_t, int64_t, int64_t, int64_t); | 14 | _static cube_t getcube(int64_t, int64_t, int64_t, int64_t); |
| 15 | 15 | ||
| 16 | _static cube_t move(cube_t, uint8_t); | ||
| 17 | _static cube_t transform_edges(cube_t, uint8_t); | 16 | _static cube_t transform_edges(cube_t, uint8_t); |
| 18 | _static cube_t transform_corners(cube_t, uint8_t); | 17 | _static cube_t transform_corners(cube_t, uint8_t); |
| 19 | _static cube_t transform(cube_t, uint8_t); | 18 | _static cube_t transform(cube_t, uint8_t); |
| 20 | 19 | ||
| 20 | /* declared in moves.h */ | ||
| 21 | _static cube_t move(cube_t, uint8_t); | ||
| 22 | |||
| 21 | _static cube_t | 23 | _static cube_t |
| 22 | cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) | 24 | cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) |
| 23 | { | 25 | { |
| @@ -239,52 +241,6 @@ applytrans(cube_t cube, const char *buf) | |||
| 239 | return transform(cube, t); | 241 | return transform(cube, t); |
| 240 | } | 242 | } |
| 241 | 243 | ||
| 242 | _static cube_t | ||
| 243 | move(cube_t c, uint8_t m) | ||
| 244 | { | ||
| 245 | switch (m) { | ||
| 246 | case _move_U: | ||
| 247 | return _move(U, c); | ||
| 248 | case _move_U2: | ||
| 249 | return _move(U2, c); | ||
| 250 | case _move_U3: | ||
| 251 | return _move(U3, c); | ||
| 252 | case _move_D: | ||
| 253 | return _move(D, c); | ||
| 254 | case _move_D2: | ||
| 255 | return _move(D2, c); | ||
| 256 | case _move_D3: | ||
| 257 | return _move(D3, c); | ||
| 258 | case _move_R: | ||
| 259 | return _move(R, c); | ||
| 260 | case _move_R2: | ||
| 261 | return _move(R2, c); | ||
| 262 | case _move_R3: | ||
| 263 | return _move(R3, c); | ||
| 264 | case _move_L: | ||
| 265 | return _move(L, c); | ||
| 266 | case _move_L2: | ||
| 267 | return _move(L2, c); | ||
| 268 | case _move_L3: | ||
| 269 | return _move(L3, c); | ||
| 270 | case _move_F: | ||
| 271 | return _move(F, c); | ||
| 272 | case _move_F2: | ||
| 273 | return _move(F2, c); | ||
| 274 | case _move_F3: | ||
| 275 | return _move(F3, c); | ||
| 276 | case _move_B: | ||
| 277 | return _move(B, c); | ||
| 278 | case _move_B2: | ||
| 279 | return _move(B2, c); | ||
| 280 | case _move_B3: | ||
| 281 | return _move(B3, c); | ||
| 282 | default: | ||
| 283 | LOG("move error, unknown move\n"); | ||
| 284 | return zero; | ||
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 | /* | 244 | /* |
| 289 | TODO transform is now relegated to a separated file because it is too long. | 245 | TODO transform is now relegated to a separated file because it is too long. |
| 290 | It would be nice to make it shorter without loosing performance. | 246 | It would be nice to make it shorter without loosing performance. |
