From b0053277e385bee23336d1fe6b69a12f49f9172f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 1 Apr 2025 09:33:26 +0200 Subject: simplified allowedmoves logic --- src/solvers/coord/solve.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/solvers/coord') diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index c3fbd02..fa4134a 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h @@ -135,7 +135,12 @@ solve_coord_dfs(dfsarg_solve_coord_t arg[static 1]) ret = 0; if (coord_continue_onnormal(arg)) { l = arg->solution_moves->nmoves; - mm = allowednextmove_mask(l, arg->solution_moves->moves); + if (l == 0) { + mm = MM_ALLMOVES; + } else { + m = arg->solution_moves->moves[l-1]; + mm = allowedmask[movebase(m)]; + } arg->solution_moves->nmoves++; arg->lastisnormal = true; @@ -160,7 +165,12 @@ solve_coord_dfs(dfsarg_solve_coord_t arg[static 1]) if (coord_continue_oninverse(arg)) { l = arg->solution_moves->npremoves; - mm = allowednextmove_mask(l, arg->solution_moves->premoves); + if (l == 0) { + mm = MM_ALLMOVES; + } else { + m = arg->solution_moves->premoves[l-1]; + mm = allowedmask[movebase(m)]; + } arg->solution_moves->npremoves++; arg->lastisnormal = false; -- cgit v1.3