diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-28 10:11:25 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-28 10:11:25 +0200 |
| commit | fd865fc493af21efe02f54f2a557c36f43aed3c3 (patch) | |
| tree | 006c08f4bc7eaa42f9b3758bd2171dd825361f77 /src | |
| parent | 90fd8880f9f0db3f55335141d2f2799cea43b118 (diff) | |
| download | nissy-classic-fd865fc493af21efe02f54f2a557c36f43aed3c3.tar.gz nissy-classic-fd865fc493af21efe02f54f2a557c36f43aed3c3.zip | |
Do not print qt-equivalent HTRs
Diffstat (limited to 'src')
| -rw-r--r-- | src/steps.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/src/steps.c b/src/steps.c index 6754d22..85732e7 100644 --- a/src/steps.c +++ b/src/steps.c | |||
| @@ -38,6 +38,7 @@ static int estimate_nxoptlike(DfsArg *arg, PruneData *pd); | |||
| 38 | 38 | ||
| 39 | static bool always_valid(Alg *alg); | 39 | static bool always_valid(Alg *alg); |
| 40 | static bool validate_singlecw_ending(Alg *alg); | 40 | static bool validate_singlecw_ending(Alg *alg); |
| 41 | static bool validate_htr_qt(Alg *alg); | ||
| 41 | 42 | ||
| 42 | /* Pre-transformation detectors **********************************************/ | 43 | /* Pre-transformation detectors **********************************************/ |
| 43 | 44 | ||
| @@ -407,7 +408,7 @@ cornershtr_HTM = { | |||
| 407 | .is_done = check_cornershtr, | 408 | .is_done = check_cornershtr, |
| 408 | .estimate = estimate_cornershtr_HTM, | 409 | .estimate = estimate_cornershtr_HTM, |
| 409 | .ready = NULL, | 410 | .ready = NULL, |
| 410 | .is_valid = validate_singlecw_ending, | 411 | .is_valid = validate_htr_qt, |
| 411 | .moveset = &moveset_HTM, | 412 | .moveset = &moveset_HTM, |
| 412 | 413 | ||
| 413 | .pre_trans = uf, | 414 | .pre_trans = uf, |
| @@ -903,7 +904,7 @@ htr_any = { | |||
| 903 | .estimate = estimate_htr_drud, | 904 | .estimate = estimate_htr_drud, |
| 904 | .ready = check_drud, | 905 | .ready = check_drud, |
| 905 | .ready_msg = check_drany_msg, | 906 | .ready_msg = check_drany_msg, |
| 906 | .is_valid = validate_singlecw_ending, | 907 | .is_valid = validate_htr_qt, |
| 907 | .moveset = &moveset_drud, | 908 | .moveset = &moveset_drud, |
| 908 | 909 | ||
| 909 | .detect = detect_pretrans_drud, | 910 | .detect = detect_pretrans_drud, |
| @@ -922,7 +923,7 @@ htr_drud = { | |||
| 922 | .estimate = estimate_htr_drud, | 923 | .estimate = estimate_htr_drud, |
| 923 | .ready = check_drud, | 924 | .ready = check_drud, |
| 924 | .ready_msg = check_dr_msg, | 925 | .ready_msg = check_dr_msg, |
| 925 | .is_valid = validate_singlecw_ending, | 926 | .is_valid = validate_htr_qt, |
| 926 | .moveset = &moveset_drud, | 927 | .moveset = &moveset_drud, |
| 927 | 928 | ||
| 928 | .pre_trans = uf, | 929 | .pre_trans = uf, |
| @@ -941,7 +942,7 @@ htr_drrl = { | |||
| 941 | .estimate = estimate_htr_drud, | 942 | .estimate = estimate_htr_drud, |
| 942 | .ready = check_drud, | 943 | .ready = check_drud, |
| 943 | .ready_msg = check_dr_msg, | 944 | .ready_msg = check_dr_msg, |
| 944 | .is_valid = validate_singlecw_ending, | 945 | .is_valid = validate_htr_qt, |
| 945 | .moveset = &moveset_drud, | 946 | .moveset = &moveset_drud, |
| 946 | 947 | ||
| 947 | .pre_trans = rf, | 948 | .pre_trans = rf, |
| @@ -960,7 +961,7 @@ htr_drfb = { | |||
| 960 | .estimate = estimate_htr_drud, | 961 | .estimate = estimate_htr_drud, |
| 961 | .ready = check_drud, | 962 | .ready = check_drud, |
| 962 | .ready_msg = check_dr_msg, | 963 | .ready_msg = check_dr_msg, |
| 963 | .is_valid = validate_singlecw_ending, | 964 | .is_valid = validate_htr_qt, |
| 964 | .moveset = &moveset_drud, | 965 | .moveset = &moveset_drud, |
| 965 | 966 | ||
| 966 | .pre_trans = fd, | 967 | .pre_trans = fd, |
| @@ -1599,6 +1600,40 @@ validate_singlecw_ending(Alg *alg) | |||
| 1599 | return nor && inv; | 1600 | return nor && inv; |
| 1600 | } | 1601 | } |
| 1601 | 1602 | ||
| 1603 | static bool | ||
| 1604 | validate_htr_qt(Alg *alg) | ||
| 1605 | { | ||
| 1606 | int i, lastqt, lastqt_n, lastqt_i; | ||
| 1607 | Move m, b; | ||
| 1608 | |||
| 1609 | if (!validate_singlecw_ending(alg)) | ||
| 1610 | return false; | ||
| 1611 | |||
| 1612 | lastqt_n = lastqt_i = -1; | ||
| 1613 | for (i = 0; i < alg->len; i++) { | ||
| 1614 | m = alg->move[i]; | ||
| 1615 | b = base_move(m); | ||
| 1616 | if (m == b+1) | ||
| 1617 | continue; | ||
| 1618 | if (alg->inv[i] && lastqt_i == -1) | ||
| 1619 | lastqt_i = i; | ||
| 1620 | if (!alg->inv[i]) | ||
| 1621 | lastqt_n = i; | ||
| 1622 | } | ||
| 1623 | lastqt = lastqt_n == -1 ? lastqt_i : lastqt_n; | ||
| 1624 | |||
| 1625 | for (i = 0; i < alg->len; i++) { | ||
| 1626 | m = alg->move[i]; | ||
| 1627 | b = base_move(m); | ||
| 1628 | if (m == b+1 || i == lastqt) | ||
| 1629 | continue; | ||
| 1630 | if (b == D || b == L || b == B) | ||
| 1631 | return false; | ||
| 1632 | } | ||
| 1633 | |||
| 1634 | return true; | ||
| 1635 | } | ||
| 1636 | |||
| 1602 | /* Pre-transformation detectors **********************************************/ | 1637 | /* Pre-transformation detectors **********************************************/ |
| 1603 | 1638 | ||
| 1604 | static int | 1639 | static int |
