From 3568412f8f230774d0d11d7ed1c897424f95d3ef Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 11 Nov 2021 21:37:34 +0100 Subject: Rewritten from scratch. Welocme nissy 2.0! --- old/2021-02-18-piecefilter/src/moves.h | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 old/2021-02-18-piecefilter/src/moves.h (limited to 'old/2021-02-18-piecefilter/src/moves.h') 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 @@ +#ifndef MOVES_H +#define MOVES_H + +#include +#include +#include +#include "cube.h" +#include "utils.h" + +#define NMOVES (z3+1) + +typedef enum { + NULLMOVE, + U, U2, U3, D, D2, D3, R, R2, R3, L, L2, L3, F, F2, F3, B, B2, B3, + Uw, Uw2, Uw3, Dw, Dw2, Dw3, Rw, Rw2, Rw3, + Lw, Lw2, Lw3, Fw, Fw2, Fw3, Bw, Bw2, Bw3, + M, M2, M3, S, S2, S3, E, E2, E3, + x, x2, x3, y, y2, y3, z, z2, z3, +} Move; + +/* An alg is an array of "NissMoves", which can be on normal or on inverse. */ +typedef struct { bool inverse; Move m; } NissMove; + +/* Movesets */ +extern bool standard_moveset[NMOVES]; + +extern bool commute[NMOVES][NMOVES]; +extern bool possible_next[NMOVES][NMOVES][NMOVES]; +extern Move inverse[NMOVES]; + +bool is_solve_up_to_reorient(Cube cube); +int copy_alg(NissMove *src, NissMove *dest); /*return number of moves copied */ +void print_moves(NissMove *alg); +int read_moves(char *str, NissMove *alg, int n); /* reads at most n moves */ +void cleanup(NissMove *src, int n); /* rewrites using basic moves, at most n */ +Cube move_cube(Move m, Cube cube); +/* I might want to replace this with two versions, one that uses PieceFilter */ +Cube apply_alg(NissMove *alg, Cube cube); + +/* Merge the following two? + always in this order */ +void init_ttables(bool read, bool write); +void init_aux_tables(); + + +#endif -- cgit v1.3