diff options
Diffstat (limited to '')
| -rw-r--r-- | old/2021-05-26-before-restyle/solve.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/old/2021-05-26-before-restyle/solve.h b/old/2021-05-26-before-restyle/solve.h deleted file mode 100644 index 0b59cc2..0000000 --- a/old/2021-05-26-before-restyle/solve.h +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | #ifndef SOLVE_H | ||
| 2 | #define SOLVE_H | ||
| 3 | |||
| 4 | #include <stdlib.h> | ||
| 5 | #include "cube.h" | ||
| 6 | #include "moves.h" | ||
| 7 | #include "transformations.h" | ||
| 8 | |||
| 9 | /* Maximum number of moves per solution and of solutions */ | ||
| 10 | #define MAXM 30 | ||
| 11 | #define MAXS 999 | ||
| 12 | |||
| 13 | /* Data for solving a step: | ||
| 14 | - can_niss is true niss can be used, false otherwise. | ||
| 15 | - optimal_only if true, dynamically updates max_moves so non-optimal | ||
| 16 | solutions are discarded. | ||
| 17 | - cleanup determines whether the cleaunup() function should be used on | ||
| 18 | the found solutions before returning. | ||
| 19 | - available[m] is true if the move m can be used, false otherwise. | ||
| 20 | (Rename to moveset[]?) | ||
| 21 | - min_moves and max_moves are the minimum and maximum number of moves that | ||
| 22 | can be used. | ||
| 23 | - max_solution is the maximum number of solutions that can be returned. | ||
| 24 | - precondition can be used to check wheter the step can actually be applied | ||
| 25 | to the cube. If it returns false, solve() stops immediately returning -1. | ||
| 26 | - f must return 0 if and only if the step is solve, otherwise it must return | ||
| 27 | a lower bound for the number of moves required (without niss). | ||
| 28 | - sorted_moves[] can be used to specify in which order moves are tried | ||
| 29 | by the solving algorithm (for example if one wants to always try F' before | ||
| 30 | F). If sorted_moves[0] == NULLMOVE, the list is generated automatically. | ||
| 31 | It is advised to list first all the moves that actually influence the | ||
| 32 | solved state of the step (this is the default choice). This is in order to | ||
| 33 | avoid cases like B2 F for EO and to NISS only when it makes sense. | ||
| 34 | - start_moves [Currently unused, REMOVE] | ||
| 35 | are the moves that will be used as first moves of all | ||
| 36 | solutions. For example giving R' U' F (F' U R) will generate FMC scrambles | ||
| 37 | and y (y) will solve the step on another axis. | ||
| 38 | - pre_rotation are the rotations to apply before the scamble to solve | ||
| 39 | the step wrt a different orientation | ||
| 40 | - pre_rotation are the rotations to apply before the scamble to solve | ||
| 41 | the step wth respect to a different orientation. | ||
| 42 | TODO: cange name | ||
| 43 | - solutions[][] is the array where to store the found solutions. */ | ||
| 44 | typedef struct { | ||
| 45 | bool can_niss, optimal_only, cleanup, *available; | ||
| 46 | int min_moves, max_moves, max_solutions; | ||
| 47 | int (*f)(Cube); | ||
| 48 | bool (*precondition)(Cube); | ||
| 49 | Move sorted_moves[NMOVES]; | ||
| 50 | Transformation pre_rotation; | ||
| 51 | NissMove solutions[MAXS][MAXM]; | ||
| 52 | } SolveData; | ||
| 53 | |||
| 54 | int solve(Cube cube, SolveData *data); /* Returns the number of solutions. */ | ||
| 55 | |||
| 56 | /* Steps */ | ||
| 57 | int f_eofb(Cube cube); | ||
| 58 | |||
| 59 | #endif | ||
