aboutsummaryrefslogtreecommitdiff
path: root/old/2021-06-30-reached/cube.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 21:37:34 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 21:37:34 +0100
commit3568412f8f230774d0d11d7ed1c897424f95d3ef (patch)
tree77223792d8c925a9b1fc32b3f4341e943b5f8209 /old/2021-06-30-reached/cube.h
parent67e1b5e6e6a2c917a2fe58a37a1382c982b1e5c5 (diff)
downloadnissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.tar.gz
nissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.zip
Rewritten from scratch. Welocme nissy 2.0!
Diffstat (limited to 'old/2021-06-30-reached/cube.h')
-rw-r--r--old/2021-06-30-reached/cube.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/old/2021-06-30-reached/cube.h b/old/2021-06-30-reached/cube.h
new file mode 100644
index 0000000..ffbcd86
--- /dev/null
+++ b/old/2021-06-30-reached/cube.h
@@ -0,0 +1,90 @@
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
16extern Coordinate coord_eofb;
17extern Coordinate coord_eofbepos;
18extern Coordinate coord_coud;
19extern Coordinate coord_corners;
20extern Coordinate coord_cornershtr;
21extern Coordinate coord_drud;
22extern Coordinate coord_coud_sym16;
23extern Coordinate coord_eofbepos_sym16;
24extern Coordinate coord_drud_sym16;
25extern Coordinate coord_khuge;
26
27Cube apply_alg(Alg *alg, Cube cube);
28Cube apply_move(Move m, Cube cube);
29Cube apply_trans(Trans t, Cube cube);
30bool block_solved(Cube cube, Block);
31Cube compose(Cube c2, Cube c1); /* Use c2 as an alg on c1 */
32uint64_t cphtr(Cube cube); /* TODO: rename (something with cosets) */
33Cube anti_cphtr(uint64_t ind); /*TODO also this */
34uint64_t epos_dependent(Cube cube); /* TODO: rename and turn into an indexer */
35bool equal(Cube c1, Cube c2);
36Cube inverse_cube(Cube cube);
37Move inverse_move(Move m);
38Trans inverse_trans(Trans t);
39bool is_admissible(Cube cube);
40bool is_solved(Cube cube, bool reorient);
41bool is_solved_center(Cube cube, Center c);
42bool is_solved_corner(Cube cube, Corner c);
43bool is_solved_edge(Cube cube, Edge e);
44void print_cube(Cube cube);
45Cube random_cube();
46AlgList * solve(Cube cube, Step step, SolveOptions *opts);
47Center what_center_at(Cube cube, Center c);
48Corner what_corner_at(Cube cube, Corner c);
49Edge what_edge_at(Cube cube, Edge e);
50int what_orientation_corner(int co, Corner c);
51int what_orientation_edge(int eo, Edge e);
52Center where_is_center(Cube cube, Center c);
53Corner where_is_corner(Cube cube, Corner c);
54Edge where_is_edge(Cube cube, Edge e);
55
56bool check_centers(Cube cube);
57bool check_corners(Cube cube);
58bool check_cornershtr(Cube cube);
59bool check_coud(Cube cube);
60bool check_drud(Cube cube);
61bool check_eofb(Cube cube);
62bool check_eofbepos(Cube cube);
63bool check_epose(Cube cube);
64bool check_ep(Cube cube);
65bool check_khuge(Cube cube);
66bool check_nothing(Cube cube);
67
68bool moveset_HTM(Move m);
69bool moveset_URF(Move m);
70
71Move base_move(Move m);
72void free_alg(Alg *alg);
73void free_alglist(AlgList *l);
74Alg * inverse_alg(Alg *alg);
75Alg * new_alg(char *str);
76Alg * on_inverse(Alg *alg);
77void print_alg(Alg *alg, bool l);
78void print_alglist(AlgList *al, bool l);
79Alg * rotation_alg(Trans i);
80void transform_alg(Trans t, Alg *alg);
81
82void genptable(PruneData *pd);
83void print_ptable(PruneData *pd);
84uint64_t ptablesize(PruneData *pd);
85int ptableval(PruneData *pd, Cube cube);
86
87void init();
88
89#endif
90

Generated with cgit - Back to sebastiano.tronto.net