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