diff options
Diffstat (limited to 'old/2021-07-15-almostbeforerefactor/cube.h')
| -rw-r--r-- | old/2021-07-15-almostbeforerefactor/cube.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/old/2021-07-15-almostbeforerefactor/cube.h b/old/2021-07-15-almostbeforerefactor/cube.h new file mode 100644 index 0000000..c400d14 --- /dev/null +++ b/old/2021-07-15-almostbeforerefactor/cube.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | #ifndef CUBE_H | ||
| 2 | #define CUBE_H | ||
| 3 | |||
| 4 | #include <stdio.h> | ||
| 5 | #include <stdbool.h> | ||
| 6 | #include <stdint.h> | ||
| 7 | #include <stdlib.h> | ||
| 8 | #include <string.h> | ||
| 9 | #include <time.h> | ||
| 10 | #include <unistd.h> | ||
| 11 | #include <sys/stat.h> | ||
| 12 | |||
| 13 | #include "macros.h" | ||
| 14 | #include "cubetypes.h" | ||
| 15 | |||
| 16 | extern Coordinate coord_eofb; | ||
| 17 | extern Coordinate coord_eofbepos; | ||
| 18 | extern Coordinate coord_coud; | ||
| 19 | extern Coordinate coord_corners; | ||
| 20 | extern Coordinate coord_cornershtr; | ||
| 21 | extern Coordinate coord_drud; | ||
| 22 | extern Coordinate coord_coud_sym16; | ||
| 23 | extern Coordinate coord_eofbepos_sym16; | ||
| 24 | extern Coordinate coord_drud_sym16; | ||
| 25 | extern Coordinate coord_khuge; | ||
| 26 | |||
| 27 | extern Trans trans_group_udfix[16]; | ||
| 28 | extern Trans trans_group_trivial[1]; | ||
| 29 | |||
| 30 | Cube apply_alg(Alg *alg, Cube cube); | ||
| 31 | Cube apply_move(Move m, Cube cube); | ||
| 32 | Cube apply_trans(Trans t, Cube cube); | ||
| 33 | bool block_solved(Cube cube, Block); | ||
| 34 | Cube compose(Cube c2, Cube c1); /* Use c2 as an alg on c1 */ | ||
| 35 | uint64_t cphtr(Cube cube); /* TODO: rename (something with cosets) */ | ||
| 36 | Cube anti_cphtr(uint64_t ind); /*TODO also this */ | ||
| 37 | uint64_t epos_dependent(Cube cube); /* TODO: rename and turn into an indexer */ | ||
| 38 | bool equal(Cube c1, Cube c2); | ||
| 39 | Cube inverse_cube(Cube cube); | ||
| 40 | Move inverse_move(Move m); | ||
| 41 | Trans inverse_trans(Trans t); | ||
| 42 | bool is_admissible(Cube cube); | ||
| 43 | bool is_solved(Cube cube, bool reorient); | ||
| 44 | bool is_solved_center(Cube cube, Center c); | ||
| 45 | bool is_solved_corner(Cube cube, Corner c); | ||
| 46 | bool is_solved_edge(Cube cube, Edge e); | ||
| 47 | void print_cube(Cube cube); | ||
| 48 | Cube random_cube(); | ||
| 49 | AlgList * solve(Cube cube, Step step, SolveOptions *opts); | ||
| 50 | Center what_center_at(Cube cube, Center c); | ||
| 51 | Corner what_corner_at(Cube cube, Corner c); | ||
| 52 | Edge what_edge_at(Cube cube, Edge e); | ||
| 53 | int what_orientation_corner(int co, Corner c); | ||
| 54 | int what_orientation_edge(int eo, Edge e); | ||
| 55 | Center where_is_center(Cube cube, Center c); | ||
| 56 | Corner where_is_corner(Cube cube, Corner c); | ||
| 57 | Edge where_is_edge(Cube cube, Edge e); | ||
| 58 | |||
| 59 | bool check_centers(Cube cube); | ||
| 60 | bool check_corners(Cube cube); | ||
| 61 | bool check_cornershtr(Cube cube); | ||
| 62 | bool check_coud(Cube cube); | ||
| 63 | bool check_drud(Cube cube); | ||
| 64 | bool check_eofb(Cube cube); | ||
| 65 | bool check_eofbepos(Cube cube); | ||
| 66 | bool check_epose(Cube cube); | ||
| 67 | bool check_ep(Cube cube); | ||
| 68 | bool check_khuge(Cube cube); | ||
| 69 | bool check_nothing(Cube cube); | ||
| 70 | |||
| 71 | void genptable(PruneData *pd); | ||
| 72 | void print_ptable(PruneData *pd); | ||
| 73 | uint64_t ptablesize(PruneData *pd); | ||
| 74 | int ptableval(PruneData *pd, Cube cube); | ||
| 75 | |||
| 76 | void init(); | ||
| 77 | |||
| 78 | #endif | ||
| 79 | |||
