diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-26 19:22:50 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-26 19:22:50 +0100 |
| commit | 83338a2f753ebbb7ba7b154cc60b2f427b6121b0 (patch) | |
| tree | 149efb6a0b835fd6b3d89f7fd7808f8eed8e0288 /src/core | |
| parent | 56048d13b73ec6e6a9c59d62e82f41e69a3994bd (diff) | |
| download | nissy-core-83338a2f753ebbb7ba7b154cc60b2f427b6121b0.tar.gz nissy-core-83338a2f753ebbb7ba7b154cc60b2f427b6121b0.zip | |
Added inverse coordinate for CO
this is necessary for DR coordinate
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/cube.h | 2 | ||||
| -rw-r--r-- | src/core/io_moves.h | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/core/cube.h b/src/core/cube.h index 7a68fb2..3dd3ccb 100644 --- a/src/core/cube.h +++ b/src/core/cube.h | |||
| @@ -61,7 +61,7 @@ isconsistent(cube_t cube) | |||
| 61 | } | 61 | } |
| 62 | for (i = 0; i < 8; i++) | 62 | for (i = 0; i < 8; i++) |
| 63 | if (!found[i]) | 63 | if (!found[i]) |
| 64 | goto inconsistent_co; | 64 | goto inconsistent_cp; |
| 65 | 65 | ||
| 66 | return true; | 66 | return true; |
| 67 | 67 | ||
diff --git a/src/core/io_moves.h b/src/core/io_moves.h index b00682b..c94b6b7 100644 --- a/src/core/io_moves.h +++ b/src/core/io_moves.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | STATIC uint8_t readmove(char); | 1 | STATIC uint8_t readmove(char); |
| 2 | STATIC int64_t readmoves(const char *, size_t n, uint8_t [n]); | 2 | STATIC int64_t readmoves(const char *, size_t n, uint8_t [n]); |
| 3 | STATIC int64_t countmoves(const char *); | ||
| 3 | STATIC uint8_t readmodifier(char); | 4 | STATIC uint8_t readmodifier(char); |
| 4 | STATIC int64_t writemoves(size_t n, const uint8_t [n], size_t m, char [m]); | 5 | STATIC int64_t writemoves(size_t n, const uint8_t [n], size_t m, char [m]); |
| 5 | 6 | ||
| @@ -72,6 +73,21 @@ readmoves(const char *buf, size_t n, uint8_t ret[n]) | |||
| 72 | } | 73 | } |
| 73 | 74 | ||
| 74 | STATIC int64_t | 75 | STATIC int64_t |
| 76 | countmoves(const char *buf) | ||
| 77 | { | ||
| 78 | uint8_t m; | ||
| 79 | uint64_t c; | ||
| 80 | |||
| 81 | FOREACH_READMOVE(buf, m, c, INT_MAX, NISSY_ERROR_INVALID_MOVES, | ||
| 82 | {} | ||
| 83 | ) | ||
| 84 | |||
| 85 | (void)m; /* Ignore "variable set but not used" warning */ | ||
| 86 | |||
| 87 | return (int64_t)c; | ||
| 88 | } | ||
| 89 | |||
| 90 | STATIC int64_t | ||
| 75 | writemoves( | 91 | writemoves( |
| 76 | size_t nmoves, | 92 | size_t nmoves, |
| 77 | const uint8_t m[nmoves], | 93 | const uint8_t m[nmoves], |
