aboutsummaryrefslogtreecommitdiff
path: root/src/solve_generic.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-06-09 12:43:49 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-06-09 12:43:49 +0200
commitc5c5017a335208881e27fc8f72c1d0145a04622a (patch)
tree7a1518e5b05f3fbde810fa3080c41099ba7d5ae8 /src/solve_generic.h
parent28ad019d62583b7e89b4e76922aa73857d5876eb (diff)
downloadnissy-core-c5c5017a335208881e27fc8f72c1d0145a04622a.tar.gz
nissy-core-c5c5017a335208881e27fc8f72c1d0145a04622a.zip
Remvoed cube_fast_t and more. More cleaning up to do.
Diffstat (limited to 'src/solve_generic.h')
-rw-r--r--src/solve_generic.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/solve_generic.h b/src/solve_generic.h
index 6cdcc33..b5d1e2d 100644
--- a/src/solve_generic.h
+++ b/src/solve_generic.h
@@ -1,19 +1,19 @@
1typedef struct { 1typedef struct {
2 cube_fast_t cube; 2 cube_t cube;
3 uint8_t depth; 3 uint8_t depth;
4 int64_t maxsols; 4 int64_t maxsols;
5 char **nextsol; 5 char **nextsol;
6 int64_t *nsols; 6 int64_t *nsols;
7 uint8_t nmoves; 7 uint8_t nmoves;
8 uint8_t moves[20]; 8 uint8_t moves[20];
9 uint8_t (*estimate)(cube_fast_t); 9 uint8_t (*estimate)(cube_t);
10} dfsarg_generic_t; 10} dfsarg_generic_t;
11 11
12_static void solve_generic_appendsolution(dfsarg_generic_t *); 12_static void solve_generic_appendsolution(dfsarg_generic_t *);
13_static int solve_generic_dfs(dfsarg_generic_t *); 13_static int solve_generic_dfs(dfsarg_generic_t *);
14_static int64_t solve_generic(cube_t, const char *, int8_t, int8_t, int64_t, 14_static int64_t solve_generic(cube_t, const char *, int8_t, int8_t, int64_t,
15 int8_t, char *, uint8_t (*)(cube_fast_t)); 15 int8_t, char *, uint8_t (*)(cube_t));
16_static uint8_t estimate_simple(cube_fast_t); 16_static uint8_t estimate_simple(cube_t);
17_static int64_t solve_simple(cube_t, int8_t, int8_t, int64_t, int8_t, char *); 17_static int64_t solve_simple(cube_t, int8_t, int8_t, int64_t, int8_t, char *);
18 18
19int64_t 19int64_t
@@ -135,7 +135,7 @@ solve_generic(
135 int64_t maxsols, 135 int64_t maxsols,
136 int8_t optimal, 136 int8_t optimal,
137 char *sols, 137 char *sols,
138 uint8_t (*estimate)(cube_fast_t) 138 uint8_t (*estimate)(cube_t)
139 /* TODO: add validator */ 139 /* TODO: add validator */
140 /* TODO: maybe add data for estimate */ 140 /* TODO: maybe add data for estimate */
141 /* TODO: add moveset (and allowednext?) */ 141 /* TODO: add moveset (and allowednext?) */
@@ -190,7 +190,7 @@ solve_generic(
190 } 190 }
191 191
192 arg = (dfsarg_generic_t) { 192 arg = (dfsarg_generic_t) {
193 .cube = cubetofast(cube), 193 .cube = cube,
194 .maxsols = maxsols, 194 .maxsols = maxsols,
195 .nextsol = &sols, 195 .nextsol = &sols,
196 .nsols = &ret, 196 .nsols = &ret,
@@ -223,9 +223,9 @@ solve_generic(
223} 223}
224 224
225_static uint8_t 225_static uint8_t
226estimate_simple(cube_fast_t cube) 226estimate_simple(cube_t cube)
227{ 227{
228 return issolved_fast(cube) ? 0 : 1; 228 return issolved(cube) ? 0 : 1;
229} 229}
230 230
231_static int64_t 231_static int64_t

Generated with cgit - Back to sebastiano.tronto.net