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-23-realizing-bad-tables/cubetypes.h | |
| parent | 3568412f8f230774d0d11d7ed1c897424f95d3ef (diff) | |
| download | nissy-4fb67201414169a2687f41c4056b2e284b4938cb.tar.gz nissy-4fb67201414169a2687f41c4056b2e284b4938cb.zip | |
Removed old files
Diffstat (limited to 'old/2021-06-23-realizing-bad-tables/cubetypes.h')
| -rw-r--r-- | old/2021-06-23-realizing-bad-tables/cubetypes.h | 224 |
1 files changed, 0 insertions, 224 deletions
diff --git a/old/2021-06-23-realizing-bad-tables/cubetypes.h b/old/2021-06-23-realizing-bad-tables/cubetypes.h deleted file mode 100644 index 886295c..0000000 --- a/old/2021-06-23-realizing-bad-tables/cubetypes.h +++ /dev/null | |||
| @@ -1,224 +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 algset AlgSet; | ||
| 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 | typedef Cube (*AntiIndexer) (uint64_t); | ||
| 23 | typedef int (*Checker) (Cube, int); | ||
| 24 | typedef uint64_t (*Indexer) (Cube); | ||
| 25 | typedef bool (*Moveset) (Move); | ||
| 26 | |||
| 27 | |||
| 28 | /* Enums *********************************************************************/ | ||
| 29 | |||
| 30 | enum | ||
| 31 | center | ||
| 32 | { | ||
| 33 | U_center, D_center, | ||
| 34 | R_center, L_center, | ||
| 35 | F_center, B_center | ||
| 36 | }; | ||
| 37 | |||
| 38 | enum | ||
| 39 | corner | ||
| 40 | { | ||
| 41 | UFR, UFL, UBL, UBR, | ||
| 42 | DFR, DFL, DBL, DBR | ||
| 43 | }; | ||
| 44 | |||
| 45 | enum | ||
| 46 | edge | ||
| 47 | { | ||
| 48 | UF, UL, UB, UR, | ||
| 49 | DF, DL, DB, DR, | ||
| 50 | FR, FL, BL, BR | ||
| 51 | }; | ||
| 52 | |||
| 53 | enum | ||
| 54 | move | ||
| 55 | { | ||
| 56 | NULLMOVE, | ||
| 57 | U, U2, U3, D, D2, D3, | ||
| 58 | R, R2, R3, L, L2, L3, | ||
| 59 | F, F2, F3, B, B2, B3, | ||
| 60 | Uw, Uw2, Uw3, Dw, Dw2, Dw3, | ||
| 61 | Rw, Rw2, Rw3, Lw, Lw2, Lw3, | ||
| 62 | Fw, Fw2, Fw3, Bw, Bw2, Bw3, | ||
| 63 | M, M2, M3, | ||
| 64 | S, S2, S3, | ||
| 65 | E, E2, E3, | ||
| 66 | x, x2, x3, | ||
| 67 | y, y2, y3, | ||
| 68 | z, z2, z3, | ||
| 69 | }; | ||
| 70 | |||
| 71 | enum | ||
| 72 | trans | ||
| 73 | { | ||
| 74 | uf, ur, ub, ul, | ||
| 75 | df, dr, db, dl, | ||
| 76 | rf, rd, rb, ru, | ||
| 77 | lf, ld, lb, lu, | ||
| 78 | fu, fr, fd, fl, | ||
| 79 | bu, br, bd, bl, | ||
| 80 | mirror, /* R|L */ | ||
| 81 | }; | ||
| 82 | |||
| 83 | |||
| 84 | /* Structs *******************************************************************/ | ||
| 85 | |||
| 86 | struct | ||
| 87 | alg | ||
| 88 | { | ||
| 89 | Move * move; | ||
| 90 | bool * inv; | ||
| 91 | int len; | ||
| 92 | int allocated; | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct | ||
| 96 | alglist | ||
| 97 | { | ||
| 98 | AlgListNode * first; | ||
| 99 | AlgListNode * last; | ||
| 100 | int len; | ||
| 101 | }; | ||
| 102 | |||
| 103 | struct | ||
| 104 | alglistnode | ||
| 105 | { | ||
| 106 | Alg * alg; | ||
| 107 | AlgListNode * next; | ||
| 108 | }; | ||
| 109 | |||
| 110 | struct | ||
| 111 | block | ||
| 112 | { | ||
| 113 | bool edge[12]; | ||
| 114 | bool corner[8]; | ||
| 115 | bool center[6]; | ||
| 116 | }; | ||
| 117 | |||
| 118 | struct | ||
| 119 | cube | ||
| 120 | { | ||
| 121 | int epose; | ||
| 122 | int eposs; | ||
| 123 | int eposm; | ||
| 124 | int eofb; | ||
| 125 | int eorl; | ||
| 126 | int eoud; | ||
| 127 | int cp; | ||
| 128 | int coud; | ||
| 129 | int cofb; | ||
| 130 | int corl; | ||
| 131 | int cpos; | ||
| 132 | }; | ||
| 133 | |||
| 134 | struct | ||
| 135 | cubearray | ||
| 136 | { | ||
| 137 | int * ep; | ||
| 138 | int * eofb; | ||
| 139 | int * eorl; | ||
| 140 | int * eoud; | ||
| 141 | int * cp; | ||
| 142 | int * coud; | ||
| 143 | int * corl; | ||
| 144 | int * cofb; | ||
| 145 | int * cpos; | ||
| 146 | }; | ||
| 147 | |||
| 148 | struct | ||
| 149 | dfsdata | ||
| 150 | { | ||
| 151 | int d; | ||
| 152 | int m; | ||
| 153 | int lb; | ||
| 154 | bool niss; | ||
| 155 | Move last1; | ||
| 156 | Move last2; | ||
| 157 | AlgList * sols; | ||
| 158 | Alg * current_alg; | ||
| 159 | Move sorted_moves[NMOVES]; | ||
| 160 | int move_position[NMOVES]; | ||
| 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 | Indexer index; | ||
| 189 | Moveset moveset; | ||
| 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 | Trans pre_trans; | ||
| 202 | }; | ||
| 203 | |||
| 204 | struct | ||
| 205 | step | ||
| 206 | { | ||
| 207 | Checker check; | ||
| 208 | Checker ready; | ||
| 209 | Moveset moveset; | ||
| 210 | }; | ||
| 211 | |||
| 212 | /* TODO: I put it here because it needs the definition of Step, sort it out */ | ||
| 213 | struct | ||
| 214 | algset | ||
| 215 | { | ||
| 216 | char * filename; | ||
| 217 | AlgList ** table; | ||
| 218 | bool generated; | ||
| 219 | uint64_t size; | ||
| 220 | Indexer index; | ||
| 221 | AntiIndexer antindex; | ||
| 222 | Step step; | ||
| 223 | SolveOptions opts; | ||
| 224 | }; | ||
