diff options
| -rw-r--r-- | src/steps.c | 112 |
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); | |||
| 14 | static bool check_drud(Cube cube); | 14 | static bool check_drud(Cube cube); |
| 15 | static bool check_drud_or_drrl(Cube cube); | 15 | static bool check_drud_or_drrl(Cube cube); |
| 16 | static bool check_htr(Cube cube); | 16 | static bool check_htr(Cube cube); |
| 17 | static bool check_drudslice(Cube cube); | ||
| 17 | 18 | ||
| 18 | static int estimate_eofb_HTM(DfsArg *arg); | 19 | static int estimate_eofb_HTM(DfsArg *arg); |
| 19 | static int estimate_coud_HTM(DfsArg *arg); | 20 | static int estimate_coud_HTM(DfsArg *arg); |
| @@ -26,6 +27,7 @@ static int estimate_drud_HTM(DfsArg *arg); | |||
| 26 | static int estimate_drud_eofb(DfsArg *arg); | 27 | static int estimate_drud_eofb(DfsArg *arg); |
| 27 | static int estimate_dr_eofb(DfsArg *arg); | 28 | static int estimate_dr_eofb(DfsArg *arg); |
| 28 | static int estimate_drudfin_drud(DfsArg *arg); | 29 | static int estimate_drudfin_drud(DfsArg *arg); |
| 30 | static int estimate_drudslice_drud(DfsArg *arg); | ||
| 29 | static int estimate_htr_drud(DfsArg *arg); | 31 | static int estimate_htr_drud(DfsArg *arg); |
| 30 | static int estimate_cp_drud(DfsArg *arg); | 32 | static int estimate_cp_drud(DfsArg *arg); |
| 31 | static int estimate_htrfin_htr(DfsArg *arg); | 33 | static 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 */ | ||
| 742 | Step | ||
| 743 | dranyslice_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 | |||
| 761 | Step | ||
| 762 | drudslice_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 | |||
| 780 | Step | ||
| 781 | drrlslice_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 | |||
| 799 | Step | ||
| 800 | drfbslice_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 */ |
| 740 | Step | 819 | Step |
| 741 | dranyfin_DR = { | 820 | dranyfin_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 | ||
| 1215 | static bool | ||
| 1216 | check_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 | |||
| 1131 | static int | 1230 | static int |
| 1132 | estimate_eofb_HTM(DfsArg *arg) | 1231 | estimate_eofb_HTM(DfsArg *arg) |
| 1133 | { | 1232 | { |
| @@ -1254,6 +1353,19 @@ estimate_drudfin_drud(DfsArg *arg) | |||
| 1254 | } | 1353 | } |
| 1255 | 1354 | ||
| 1256 | static int | 1355 | static int |
| 1356 | estimate_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 | |||
| 1368 | static int | ||
| 1257 | estimate_htr_drud(DfsArg *arg) | 1369 | estimate_htr_drud(DfsArg *arg) |
| 1258 | { | 1370 | { |
| 1259 | return ptableval(&pd_htr_drud, arg->cube); | 1371 | return ptableval(&pd_htr_drud, arg->cube); |
