aboutsummaryrefslogtreecommitdiff
path: root/old/2021-02-18-piecefilter/src/moves.h
diff options
context:
space:
mode:
Diffstat (limited to 'old/2021-02-18-piecefilter/src/moves.h')
-rw-r--r--old/2021-02-18-piecefilter/src/moves.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/old/2021-02-18-piecefilter/src/moves.h b/old/2021-02-18-piecefilter/src/moves.h
new file mode 100644
index 0000000..9ccf6e4
--- /dev/null
+++ b/old/2021-02-18-piecefilter/src/moves.h
@@ -0,0 +1,46 @@
1#ifndef MOVES_H
2#define MOVES_H
3
4#include <stdio.h>
5#include <stdbool.h>
6#include <stdint.h>
7#include "cube.h"
8#include "utils.h"
9
10#define NMOVES (z3+1)
11
12typedef enum {
13 NULLMOVE,
14 U, U2, U3, D, D2, D3, R, R2, R3, L, L2, L3, F, F2, F3, B, B2, B3,
15 Uw, Uw2, Uw3, Dw, Dw2, Dw3, Rw, Rw2, Rw3,
16 Lw, Lw2, Lw3, Fw, Fw2, Fw3, Bw, Bw2, Bw3,
17 M, M2, M3, S, S2, S3, E, E2, E3,
18 x, x2, x3, y, y2, y3, z, z2, z3,
19} Move;
20
21/* An alg is an array of "NissMoves", which can be on normal or on inverse. */
22typedef struct { bool inverse; Move m; } NissMove;
23
24/* Movesets */
25extern bool standard_moveset[NMOVES];
26
27extern bool commute[NMOVES][NMOVES];
28extern bool possible_next[NMOVES][NMOVES][NMOVES];
29extern Move inverse[NMOVES];
30
31bool is_solve_up_to_reorient(Cube cube);
32int copy_alg(NissMove *src, NissMove *dest); /*return number of moves copied */
33void print_moves(NissMove *alg);
34int read_moves(char *str, NissMove *alg, int n); /* reads at most n moves */
35void cleanup(NissMove *src, int n); /* rewrites using basic moves, at most n */
36Cube move_cube(Move m, Cube cube);
37/* I might want to replace this with two versions, one that uses PieceFilter */
38Cube apply_alg(NissMove *alg, Cube cube);
39
40/* Merge the following two?
41 always in this order */
42void init_ttables(bool read, bool write);
43void init_aux_tables();
44
45
46#endif

Generated with cgit - Back to sebastiano.tronto.net