aboutsummaryrefslogtreecommitdiff
path: root/old/2021-06-14-oldalg/cubetypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'old/2021-06-14-oldalg/cubetypes.h')
-rw-r--r--old/2021-06-14-oldalg/cubetypes.h210
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
3typedef enum center Center;
4typedef enum corner Corner;
5typedef enum edge Edge;
6typedef enum move Move;
7typedef enum trans Trans;
8
9typedef struct alg Alg;
10typedef struct algnode AlgNode;
11typedef struct alglist AlgList;
12typedef struct alglistnode AlgListNode;
13typedef struct block Block;
14typedef struct cube Cube;
15typedef struct cubearray CubeArray;
16typedef struct dfsdata DfsData;
17typedef struct piecefilter PieceFilter;
18typedef struct prunedata PruneData;
19typedef struct solveoptions SolveOptions;
20typedef struct step Step;
21
22/* Enums *********************************************************************/
23
24enum
25center
26{
27 U_center, D_center,
28 R_center, L_center,
29 F_center, B_center
30};
31
32enum
33corner
34{
35 UFR, UFL, UBL, UBR,
36 DFR, DFL, DBL, DBR
37};
38
39enum
40edge
41{
42 UF, UL, UB, UR,
43 DF, DL, DB, DR,
44 FR, FL, BL, BR
45};
46
47enum
48move
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
65enum
66trans
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
80struct
81alg
82{
83 AlgNode * first;
84 AlgNode * last;
85 int len;
86};
87
88struct
89algnode
90{
91 Move m;
92 bool inverse;
93 AlgNode * next;
94 AlgNode * prev;
95};
96
97struct
98alglist
99{
100 AlgListNode * first;
101 AlgListNode * last;
102 int len;
103};
104
105struct
106alglistnode
107{
108 Alg * alg;
109 AlgListNode * next;
110};
111
112struct
113block
114{
115 bool edge[12];
116 bool corner[8];
117 bool center[6];
118};
119
120struct
121cube
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
136struct
137cubearray
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
150struct
151dfsdata
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
163struct
164piecefilter
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
179struct
180prunedata
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
192struct
193solveoptions
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
203struct
204step
205{
206 int (*check)(Cube);
207 int (*ready)(Cube);
208 bool (*moveset)(Move);
209 Trans pre_trans;
210};

Generated with cgit - Back to sebastiano.tronto.net