aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-09-08 19:30:43 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-09-08 19:30:43 +0200
commita37185d488b90eb89f5e9a949819e905919c84a8 (patch)
treedaea3b335cb39f90d5e1fe11c33d7ab5060811bc
parent4a96e5094257580eb8ad27d3fc484fa19c7f39a4 (diff)
downloadnissy-classic-a37185d488b90eb89f5e9a949819e905919c84a8.tar.gz
nissy-classic-a37185d488b90eb89f5e9a949819e905919c84a8.zip
Added drslice steps
Diffstat (limited to '')
-rw-r--r--src/steps.c112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/steps.c b/src/steps.c
index b499b30..bdcbd2a 100644
--- a/src/steps.c
+++ b/src/steps.c
@@ -14,6 +14,7 @@ static bool check_eofb(Cube cube);
14static bool check_drud(Cube cube); 14static bool check_drud(Cube cube);
15static bool check_drud_or_drrl(Cube cube); 15static bool check_drud_or_drrl(Cube cube);
16static bool check_htr(Cube cube); 16static bool check_htr(Cube cube);
17static bool check_drudslice(Cube cube);
17 18
18static int estimate_eofb_HTM(DfsArg *arg); 19static int estimate_eofb_HTM(DfsArg *arg);
19static int estimate_coud_HTM(DfsArg *arg); 20static int estimate_coud_HTM(DfsArg *arg);
@@ -26,6 +27,7 @@ static int estimate_drud_HTM(DfsArg *arg);
26static int estimate_drud_eofb(DfsArg *arg); 27static int estimate_drud_eofb(DfsArg *arg);
27static int estimate_dr_eofb(DfsArg *arg); 28static int estimate_dr_eofb(DfsArg *arg);
28static int estimate_drudfin_drud(DfsArg *arg); 29static int estimate_drudfin_drud(DfsArg *arg);
30static int estimate_drudslice_drud(DfsArg *arg);
29static int estimate_htr_drud(DfsArg *arg); 31static int estimate_htr_drud(DfsArg *arg);
30static int estimate_cp_drud(DfsArg *arg); 32static int estimate_cp_drud(DfsArg *arg);
31static int estimate_htrfin_htr(DfsArg *arg); 33static int estimate_htrfin_htr(DfsArg *arg);
@@ -736,6 +738,83 @@ drrl_eoud = {
736 .ntables = 1, 738 .ntables = 1,
737}; 739};
738 740
741/* DR finish minus slice steps */
742Step
743dranyslice_DR = {
744 .shortname = "drslice",
745 .name = "DR finish minus slice on any axis without breaking DR",
746
747 .final = true,
748 .is_done = check_drudslice,
749 .estimate = estimate_drudslice_drud,
750 .ready = check_drud,
751 .ready_msg = check_drany_msg,
752 .is_valid = always_valid,
753 .moveset = &moveset_drud,
754
755 .detect = detect_pretrans_drud,
756
757 .tables = {&pd_drudfin_noE_sym16_drud},
758 .ntables = 1,
759};
760
761Step
762drudslice_drud = {
763 .shortname = "drudslice",
764 .name = "DR finish minus slice on U/D without breaking DR",
765
766 .final = true,
767 .is_done = check_drudslice,
768 .estimate = estimate_drudslice_drud,
769 .ready = check_drud,
770 .ready_msg = check_dr_msg,
771 .is_valid = always_valid,
772 .moveset = &moveset_drud,
773
774 .pre_trans = uf,
775
776 .tables = {&pd_drudfin_noE_sym16_drud},
777 .ntables = 1,
778};
779
780Step
781drrlslice_drrl = {
782 .shortname = "drrlslice",
783 .name = "DR finish minus slice on R/L without breaking DR",
784
785 .final = true,
786 .is_done = check_drudslice,
787 .estimate = estimate_drudslice_drud,
788 .ready = check_drud,
789 .ready_msg = check_dr_msg,
790 .is_valid = always_valid,
791 .moveset = &moveset_drud,
792
793 .pre_trans = rf,
794
795 .tables = {&pd_drudfin_noE_sym16_drud},
796 .ntables = 1,
797};
798
799Step
800drfbslice_drfb = {
801 .shortname = "drfbslice",
802 .name = "DR finish minus slice on F/B without breaking DR",
803
804 .final = true,
805 .is_done = check_drudslice,
806 .estimate = estimate_drudslice_drud,
807 .ready = check_drud,
808 .ready_msg = check_dr_msg,
809 .is_valid = always_valid,
810 .moveset = &moveset_drud,
811
812 .pre_trans = fd,
813
814 .tables = {&pd_drudfin_noE_sym16_drud},
815 .ntables = 1,
816};
817
739/* DR finish steps */ 818/* DR finish steps */
740Step 819Step
741dranyfin_DR = { 820dranyfin_DR = {
@@ -1032,6 +1111,11 @@ Step *steps[] = {
1032 &drrlfin_drrl, 1111 &drrlfin_drrl,
1033 &drfbfin_drfb, 1112 &drfbfin_drfb,
1034 1113
1114 &dranyslice_DR,
1115 &drudslice_drud,
1116 &drrlslice_drrl,
1117 &drfbslice_drfb,
1118
1035 &htr_any, 1119 &htr_any,
1036 &htr_drud, 1120 &htr_drud,
1037 &htr_drrl, 1121 &htr_drrl,
@@ -1128,6 +1212,21 @@ check_htr(Cube cube)
1128 return check_drud(cube) && coord_htr_drud.index(cube) == 0; 1212 return check_drud(cube) && coord_htr_drud.index(cube) == 0;
1129} 1213}
1130 1214
1215static bool
1216check_drudslice(Cube cube)
1217{
1218 int i;
1219 Cube aux;
1220
1221 aux = cube;
1222 for (i = 0; i < 4; i++, aux = apply_move(y, aux))
1223 if (coord_cp.index(aux) == 0 &&
1224 coord_epud.index(aux) == 0)
1225 return true;
1226
1227 return false;
1228}
1229
1131static int 1230static int
1132estimate_eofb_HTM(DfsArg *arg) 1231estimate_eofb_HTM(DfsArg *arg)
1133{ 1232{
@@ -1254,6 +1353,19 @@ estimate_drudfin_drud(DfsArg *arg)
1254} 1353}
1255 1354
1256static int 1355static int
1356estimate_drudslice_drud(DfsArg *arg)
1357{
1358 int i, ret = 20;
1359 Cube aux;
1360
1361 aux = arg->cube;
1362 for (i = 0; i < 4; i++, aux = apply_move(y, aux))
1363 ret = MIN(ret, ptableval(&pd_drudfin_noE_sym16_drud, aux));
1364
1365 return ret;
1366}
1367
1368static int
1257estimate_htr_drud(DfsArg *arg) 1369estimate_htr_drud(DfsArg *arg)
1258{ 1370{
1259 return ptableval(&pd_htr_drud, arg->cube); 1371 return ptableval(&pd_htr_drud, arg->cube);

Generated with cgit - Back to sebastiano.tronto.net