diff options
Diffstat (limited to 'old/2021-06-15-before-separating-steps/cubetypes.h')
| -rw-r--r-- | old/2021-06-15-before-separating-steps/cubetypes.h | 201 |
1 files changed, 0 insertions, 201 deletions
diff --git a/old/2021-06-15-before-separating-steps/cubetypes.h b/old/2021-06-15-before-separating-steps/cubetypes.h deleted file mode 100644 index 6ba3675..0000000 --- a/old/2021-06-15-before-separating-steps/cubetypes.h +++ /dev/null | |||
| @@ -1,201 +0,0 @@ | |||
| 1 | /* Typedefs ******************************************************************/ | ||
| 2 | |||
| 3 | typedef enum center Center; | ||
| 4 | typedef enum corner Corner; | ||
| 5 | typedef enum edge Edge; | ||
| 6 | typedef enum move Move; | ||
| 7 | typedef enum trans Trans; | ||
| 8 | |||
| 9 | typedef struct alg Alg; | ||
| 10 | typedef struct alglist AlgList; | ||
| 11 | typedef struct alglistnode AlgListNode; | ||
| 12 | typedef struct block Block; | ||
| 13 | typedef struct cube Cube; | ||
| 14 | typedef struct cubearray CubeArray; | ||
| 15 | typedef struct dfsdata DfsData; | ||
| 16 | typedef struct piecefilter PieceFilter; | ||
| 17 | typedef struct prunedata PruneData; | ||
| 18 | typedef struct solveoptions SolveOptions; | ||
| 19 | typedef struct step Step; | ||
| 20 | |||
| 21 | /* Enums *********************************************************************/ | ||
| 22 | |||
| 23 | enum | ||
| 24 | center | ||
| 25 | { | ||
| 26 | U_center, D_center, | ||
| 27 | R_center, L_center, | ||
| 28 | F_center, B_center | ||
| 29 | }; | ||
| 30 | |||
| 31 | enum | ||
| 32 | corner | ||
| 33 | { | ||
| 34 | UFR, UFL, UBL, UBR, | ||
| 35 | DFR, DFL, DBL, DBR | ||
| 36 | }; | ||
| 37 | |||
| 38 | enum | ||
| 39 | edge | ||
| 40 | { | ||
| 41 | UF, UL, UB, UR, | ||
| 42 | DF, DL, DB, DR, | ||
| 43 | FR, FL, BL, BR | ||
| 44 | }; | ||
| 45 | |||
| 46 | enum | ||
| 47 | move | ||
| 48 | { | ||
| 49 | NULLMOVE, | ||
| 50 | U, U2, U3, D, D2, D3, | ||
| 51 | R, R2, R3, L, L2, L3, | ||
| 52 | F, F2, F3, B, B2, B3, | ||
| 53 | Uw, Uw2, Uw3, Dw, Dw2, Dw3, | ||
| 54 | Rw, Rw2, Rw3, Lw, Lw2, Lw3, | ||
| 55 | Fw, Fw2, Fw3, Bw, Bw2, Bw3, | ||
| 56 | M, M2, M3, | ||
| 57 | S, S2, S3, | ||
| 58 | E, E2, E3, | ||
| 59 | x, x2, x3, | ||
| 60 | y, y2, y3, | ||
| 61 | z, z2, z3, | ||
| 62 | }; | ||
| 63 | |||
| 64 | enum | ||
| 65 | trans | ||
| 66 | { | ||
| 67 | uf, ur, ub, ul, | ||
| 68 | df, dr, db, dl, | ||
| 69 | rf, rd, rb, ru, | ||
| 70 | lf, ld, lb, lu, | ||
| 71 | fu, fr, fd, fl, | ||
| 72 | bu, br, bd, bl, | ||
| 73 | mirror, /* R|L */ | ||
| 74 | }; | ||
| 75 | |||
| 76 | |||
| 77 | /* Structs *******************************************************************/ | ||
| 78 | |||
| 79 | struct | ||
| 80 | alg | ||
| 81 | { | ||
| 82 | Move * move; | ||
| 83 | bool * inv; | ||
| 84 | int len; | ||
| 85 | int allocated; | ||
| 86 | }; | ||
| 87 | |||
| 88 | struct | ||
| 89 | alglist | ||
| 90 | { | ||
| 91 | AlgListNode * first; | ||
| 92 | AlgListNode * last; | ||
| 93 | int len; | ||
| 94 | }; | ||
| 95 | |||
| 96 | struct | ||
| 97 | alglistnode | ||
| 98 | { | ||
| 99 | Alg * alg; | ||
| 100 | AlgListNode * next; | ||
| 101 | }; | ||
| 102 | |||
| 103 | struct | ||
| 104 | block | ||
| 105 | { | ||
| 106 | bool edge[12]; | ||
| 107 | bool corner[8]; | ||
| 108 | bool center[6]; | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct | ||
| 112 | cube | ||
| 113 | { | ||
| 114 | uint16_t epose; | ||
| 115 | uint16_t eposs; | ||
| 116 | uint16_t eposm; | ||
| 117 | uint16_t eofb; | ||
| 118 | uint16_t eorl; | ||
| 119 | uint16_t eoud; | ||
| 120 | uint16_t cp; | ||
| 121 | uint16_t coud; | ||
| 122 | uint16_t cofb; | ||
| 123 | uint16_t corl; | ||
| 124 | uint16_t cpos; | ||
| 125 | }; | ||
| 126 | |||
| 127 | struct | ||
| 128 | cubearray | ||
| 129 | { | ||
| 130 | int * ep; | ||
| 131 | int * eofb; | ||
| 132 | int * eorl; | ||
| 133 | int * eoud; | ||
| 134 | int * cp; | ||
| 135 | int * coud; | ||
| 136 | int * corl; | ||
| 137 | int * cofb; | ||
| 138 | int * cpos; | ||
| 139 | }; | ||
| 140 | |||
| 141 | struct | ||
| 142 | dfsdata | ||
| 143 | { | ||
| 144 | int d; | ||
| 145 | int m; | ||
| 146 | bool niss; | ||
| 147 | Move last1; | ||
| 148 | Move last2; | ||
| 149 | AlgList * sols; | ||
| 150 | Alg * current_alg; | ||
| 151 | Move sorted_moves[z3+1]; | ||
| 152 | }; | ||
| 153 | |||
| 154 | struct | ||
| 155 | piecefilter | ||
| 156 | { | ||
| 157 | bool epose; | ||
| 158 | bool eposs; | ||
| 159 | bool eposm; | ||
| 160 | bool eofb; | ||
| 161 | bool eorl; | ||
| 162 | bool eoud; | ||
| 163 | bool cp; | ||
| 164 | bool coud; | ||
| 165 | bool cofb; | ||
| 166 | bool corl; | ||
| 167 | bool cpos; | ||
| 168 | }; | ||
| 169 | |||
| 170 | struct | ||
| 171 | prunedata | ||
| 172 | { | ||
| 173 | char * filename; | ||
| 174 | uint8_t * ptable; | ||
| 175 | uint8_t * reached; | ||
| 176 | bool generated; | ||
| 177 | uint64_t n; | ||
| 178 | uint64_t size; | ||
| 179 | uint64_t (*index)(Cube); | ||
| 180 | bool (*moveset)(Move); | ||
| 181 | }; | ||
| 182 | |||
| 183 | struct | ||
| 184 | solveoptions | ||
| 185 | { | ||
| 186 | int min_moves; | ||
| 187 | int max_moves; | ||
| 188 | int max_solutions; | ||
| 189 | bool optimal_only; | ||
| 190 | bool can_niss; | ||
| 191 | bool feedback; | ||
| 192 | }; | ||
| 193 | |||
| 194 | struct | ||
| 195 | step | ||
| 196 | { | ||
| 197 | int (*check)(Cube); | ||
| 198 | int (*ready)(Cube); | ||
| 199 | bool (*moveset)(Move); | ||
| 200 | Trans pre_trans; | ||
| 201 | }; | ||
