nissy-fmc

A Rubik's cube FMC assistant
git clone https://git.tronto.net/nissy-fmc
Download | Log | Files | Refs | README | LICENSE

commit 915545b74c24670f2a03426181075f61ea210abf
parent e3108647e28d336e3814821d338ec3a841a8343c
Author: Sebastiano Tronto <sebastiano.tronto@gmail.com>
Date:   Tue, 14 Dec 2021 10:57:12 +0100

little restyling

Diffstat:
Dnissy-2.0beta6.tar.gz | 0
Msrc/steps.c | 45++++++++++++++++++++-------------------------
2 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/nissy-2.0beta6.tar.gz b/nissy-2.0beta6.tar.gz Binary files differ. diff --git a/src/steps.c b/src/steps.c @@ -1165,6 +1165,13 @@ estimate_optimal_HTM(DfsArg *arg) Move bl1; Cube aux; + static const uint64_t udmask = (1<<U) | (1<<U2) | (1<<U3) | + (1<<D) | (1<<D2) | (1<<D3); + static const uint64_t rlmask = (1<<R) | (1<<R2) | (1<<R3) | + (1<<L) | (1<<L2) | (1<<L3); + static const uint64_t fbmask = (1<<F) | (1<<F2) | (1<<F3) | + (1<<B) | (1<<B2) | (1<<B3); + ret = -1; target = arg->d - arg->current_alg->len; bl1 = base_move(arg->last1); @@ -1219,31 +1226,19 @@ estimate_optimal_HTM(DfsArg *arg) } /* nxopt trick */ - if (arg->ed->normal_ud == target) { - arg->badmovesinv |= (1<<U) | (1<<U2) | (1<<U3) | - (1<<D) | (1<<D2) | (1<<D3); - } - if (arg->ed->normal_fb == target) { - arg->badmovesinv |= (1<<F) | (1<<F2) | (1<<F3) | - (1<<B) | (1<<B2) | (1<<B3); - } - if (arg->ed->normal_rl == target) { - arg->badmovesinv |= (1<<R) | (1<<R2) | (1<<R3) | - (1<<L) | (1<<L2) | (1<<L3); - } - - if (arg->ed->inverse_ud == target) { - arg->badmoves |= (1<<U) | (1<<U2) | (1<<U3) | - (1<<D) | (1<<D2) | (1<<D3); - } - if (arg->ed->inverse_fb == target) { - arg->badmoves |= (1<<F) | (1<<F2) | (1<<F3) | - (1<<B) | (1<<B2) | (1<<B3); - } - if (arg->ed->inverse_rl == target) { - arg->badmoves |= (1<<R) | (1<<R2) | (1<<R3) | - (1<<L) | (1<<L2) | (1<<L3); - } + if (arg->ed->normal_ud == target) + arg->badmovesinv |= udmask; + if (arg->ed->normal_fb == target) + arg->badmovesinv |= fbmask; + if (arg->ed->normal_rl == target) + arg->badmovesinv |= rlmask; + + if (arg->ed->inverse_ud == target) + arg->badmoves |= udmask; + if (arg->ed->inverse_fb == target) + arg->badmoves |= fbmask; + if (arg->ed->inverse_rl == target) + arg->badmoves |= rlmask; return arg->ed->oldret = ret; }