From 87a15e960e31365698df7e06cd3e6b851e17c1a5 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 5 Mar 2023 10:13:01 +0100 Subject: I made a mess, but it works. Still need to implement new optimal solver. After that, a big redesign is due. --- src/steps.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/steps.c') diff --git a/src/steps.c b/src/steps.c index 2f5fd2c..cdba763 100644 --- a/src/steps.c +++ b/src/steps.c @@ -106,11 +106,12 @@ check_htr(Cube *cube) return true; } -bool +Alg * validate_singlecw_ending(Alg *alg) { int i; bool nor, inv; + Alg *ret; Move l2 = NULLMOVE, l1 = NULLMOVE, l2i = NULLMOVE, l1i = NULLMOVE; for (i = 0; i < alg->len; i++) { @@ -126,11 +127,19 @@ validate_singlecw_ending(Alg *alg) nor = l1 ==base_move(l1) && (!commute(l1, l2) ||l2 ==base_move(l2)); inv = l1i==base_move(l1i) && (!commute(l1i,l2i)||l2i==base_move(l2i)); - return nor && inv; + if (nor && inv) { + ret = new_alg(""); + copy_alg(alg, ret); + } else { + ret = NULL; + } + + return ret; } /* Public functions **********************************************************/ +/* void compute_ind(Step *s, Cube *cube, Movable *ind) { @@ -147,6 +156,7 @@ compute_ind(Step *s, Cube *cube, Movable *ind) ind[i].t = transform_trans(tt, t); } } +*/ void prepare_cs(ChoiceStep *cs, SolveOptions *opts) -- cgit v1.3