aboutsummaryrefslogtreecommitdiff
path: root/src/cube_public.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-08 19:22:16 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-08 19:22:16 +0200
commitc2275e4b9625a1a19eb50d0880f70ed583d5c358 (patch)
treef1b6798f017dd62ece5b56f05d5c7201ba50ff39 /src/cube_public.h
parent66c1c11ec13d362ddfb1b5f6abe8127969c0ad29 (diff)
downloadnissy-core-c2275e4b9625a1a19eb50d0880f70ed583d5c358.tar.gz
nissy-core-c2275e4b9625a1a19eb50d0880f70ed583d5c358.zip
Stats for h48 solver as tool
Diffstat (limited to 'src/cube_public.h')
-rw-r--r--src/cube_public.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/cube_public.h b/src/cube_public.h
index b537019..e080f40 100644
--- a/src/cube_public.h
+++ b/src/cube_public.h
@@ -156,17 +156,22 @@ nissy_gendata(
156 int64_t ret; 156 int64_t ret;
157 uint8_t maxdepth, h, i, j; 157 uint8_t maxdepth, h, i, j;
158 158
159 if (!strcmp(solver, "H48")) { 159 if (!strcmp(solver, "h48")) {
160 /* options are in the form "h;maxdepth" */ 160 /* options are in the form "h;maxdepth" */
161 for (i = 0; options[i] != ';'; i++) ; 161 for (i = 0; options[i] != ';'; i++) ;
162 for (j = i; options[j]; j++) ; 162 for (j = i; options[j]; j++) ;
163 h = atoi(options); 163 h = atoi(options);
164 maxdepth = atoi(&options[i+1]); 164 if (h != 0) {
165 ret = gendata_h48(data, h, maxdepth); 165 LOG("Temporarily only h=0 is supported\n");
166 } else if (!strcmp(solver, "H48stats")) { 166 ret = -1;
167 ret = gendata_cocsep(data, NULL, NULL); 167 } else {
168 maxdepth = atoi(&options[i+1]);
169 ret = gendata_h48h0k4(data, maxdepth);
170 }
171 } else if (!strcmp(solver, "h48stats")) {
172 ret = gendata_h48h0k4(data, 20);
168 } else { 173 } else {
169 LOG("gendata: implemented only for H48 solver\n"); 174 LOG("gendata: implemented only for h48 solver\n");
170 ret = -1; 175 ret = -1;
171 } 176 }
172 177
@@ -224,13 +229,13 @@ nissy_solve(
224 } 229 }
225 230
226 /* TODO define and use solve_options_t */ 231 /* TODO define and use solve_options_t */
227 if (!strcmp(solver, "H48")) { 232 if (!strcmp(solver, "h48")) {
228 h = atoi(options); /* TODO: better parsing */ 233 h = atoi(options); /* TODO: better parsing */
229 ret = solve_h48( 234 ret = solve_h48(
230 c, minmoves, maxmoves, maxsolutions, 235 c, minmoves, maxmoves, maxsolutions,
231 (uint8_t)h, data, solutions); 236 (uint8_t)h, data, solutions);
232 ret = -1; 237 ret = -1;
233 } else if (!strcmp(solver, "H48stats")) { 238 } else if (!strcmp(solver, "h48stats")) {
234 ret = solve_h48stats(c, maxmoves, data, solutions); 239 ret = solve_h48stats(c, maxmoves, data, solutions);
235 } else if (!strcmp(solver, "simple")) { 240 } else if (!strcmp(solver, "simple")) {
236 ret = solve_simple( 241 ret = solve_simple(

Generated with cgit - Back to sebastiano.tronto.net