aboutsummaryrefslogtreecommitdiff
path: root/cube.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-04-16 16:16:02 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-04-16 16:24:26 +0200
commit5378be20bc24ea0c8681da17d0585ee6ff82f788 (patch)
treee2b33612d750a35551a443d710fee5ad6f9f03f3 /cube.h
parent1cf6502c9f3d8994e5c97f90cc29392043e40f2b (diff)
downloadnissy-core-5378be20bc24ea0c8681da17d0585ee6ff82f788.tar.gz
nissy-core-5378be20bc24ea0c8681da17d0585ee6ff82f788.zip
const char *
Diffstat (limited to '')
-rw-r--r--cube.h79
1 files changed, 50 insertions, 29 deletions
diff --git a/cube.h b/cube.h
index f2d7300..32547cf 100644
--- a/cube.h
+++ b/cube.h
@@ -52,8 +52,8 @@ cube_t inverse(cube_t);
52 52
53/* TODO comment on these and the format for moves and trans */ 53/* TODO comment on these and the format for moves and trans */
54/* For trans, only one trans is supported */ 54/* For trans, only one trans is supported */
55cube_t applymoves(cube_t, char *); 55cube_t applymoves(cube_t, const char *);
56cube_t applytrans(cube_t, char *); 56cube_t applytrans(cube_t, const char *);
57 57
58/****************************************************************************** 58/******************************************************************************
59Read / write utilities 59Read / write utilities
@@ -91,8 +91,8 @@ Multiple representations of the cube as text are supported:
91 in cube_t. Corners come first, followed by edge (unlike H48). 91 in cube_t. Corners come first, followed by edge (unlike H48).
92******************************************************************************/ 92******************************************************************************/
93 93
94cube_t readcube(char *format, char *buf); 94cube_t readcube(const char *format, const char *buf);
95void writecube(char *format, cube_t cube, char *buf); 95void writecube(const char *format, cube_t cube, char *buf);
96 96
97/****************************************************************************** 97/******************************************************************************
98Solvers 98Solvers
@@ -108,36 +108,57 @@ could.
108******************************************************************************/ 108******************************************************************************/
109 109
110int64_t solve( 110int64_t solve(
111 cube_t cube, /* The cube to solve. Must be solvable. */ 111 /* The cube to solve. Must be solvable. */
112 char *solver, /* Supported solvers: 112 cube_t cube,
113 * "optimal" - currently the same as "simple" 113
114 * "simple" - a simple, slow solver using no tables 114 /* Supported solvers:
115 */ 115 * "optimal" - currently the same as "simple"
116 char *options, /* Some solvers accept extra options, 116 * "simple" - a simple, slow solver without tables
117 * like "!filter". 117 */
118 */ 118 const char *solver,
119 char *nisstype, /* Can be "normal", "inverse", "mixed" or "linear". */ 119
120 int8_t minmoves, /* The minimum number of moves. Must be >= 0. */ 120 /* Some solvers accept extra options,like "!filter". */
121 int8_t maxmoves, /* The maximum number of moves. If negative, the 121 const char *options,
122 * maximum length is unlimited. 122
123 */ 123 /* Can be "normal", "inverse", "mixed" or "linear". */
124 int64_t maxsols, /* The maximum number of solutions. */ 124 const char *nisstype,
125 int8_t optimal, /* All solutions at most "optimal" moves from the 125
126 * shortest solution (respecting minmoves) are found. 126 /* The minimum number of moves. Must be >= 0. */
127 * If negative, this parameter is ignored. 127 int8_t minmoves,
128 */ 128
129 void *data, /* Some solvers require extra data to function 129 /* The maximum number of moves. If negative, the maximum length
130 * properly (for example, pruning tables). This data 130 * is unlimited.
131 * can be generated with gendata(), see below. 131 */
132 */ 132 int8_t maxmoves,
133 char *solutions /* The solutions (return parameter) */ 133
134 /* The maximum number of solutions. */
135 int64_t maxsols,
136
137 /* All solutions at most "optimal" moves from the shortest solution
138 * (respecting minmoves) are found. If negative, it is ignored.
139 */
140 int8_t optimal,
141
142 /* Some solvers require extra data to function properly (for example,
143 * pruning tables). This data can be generated with gendata().
144 */
145 const void *data,
146
147 /* The solutions (return parameter) */
148 char *solutions
134); 149);
135 150
136/* Solving n cubes optimally, one solutions per cube. Options are similar 151/* Solving n cubes optimally, one solutions per cube. Options are similar
137 * to solve(). 152 * to solve().
138 */ 153 */
139void multisolve(int n, cube_t *cube, char *solver, void *data, char *sols); 154void multisolve(
155 int n,
156 cube_t *cube,
157 const char *solver,
158 const void *data,
159 char *sols
160);
140 161
141/* Returns the number of bytes written to data, -1 in case of error. 162/* Returns the number of bytes written to data, -1 in case of error.
142 * TODO: write down how much memory every solver requires. */ 163 * TODO: write down how much memory every solver requires. */
143int64_t gendata(char *solver, void *data); 164int64_t gendata(const char *solver, void *data);

Generated with cgit - Back to sebastiano.tronto.net