diff options
Diffstat (limited to 'old/2021-02-28-transformcube-works/src/transformations.h')
| -rw-r--r-- | old/2021-02-28-transformcube-works/src/transformations.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/old/2021-02-28-transformcube-works/src/transformations.h b/old/2021-02-28-transformcube-works/src/transformations.h new file mode 100644 index 0000000..c42cc34 --- /dev/null +++ b/old/2021-02-28-transformcube-works/src/transformations.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #ifndef TRANSFORMATIONS_H | ||
| 2 | #define TRANSFORMATIONS_H | ||
| 3 | |||
| 4 | #include <stdio.h> | ||
| 5 | #include <stdbool.h> | ||
| 6 | #include <stdint.h> | ||
| 7 | #include "cube.h" | ||
| 8 | #include "moves.h" | ||
| 9 | #include "utils.h" | ||
| 10 | |||
| 11 | #define NROTATIONS (mirror+1) | ||
| 12 | |||
| 13 | /* Letters indicate top and front centers | ||
| 14 | * Mirror is wrt rl | ||
| 15 | * Lowercase letter to distinguish from pieces */ | ||
| 16 | |||
| 17 | typedef enum { | ||
| 18 | uf, ur, ub, ul, | ||
| 19 | df, dr, db, dl, | ||
| 20 | rf, rd, rb, ru, | ||
| 21 | lf, ld, lb, lu, | ||
| 22 | fu, fr, fd, fl, | ||
| 23 | bu, br, bd, bl, | ||
| 24 | mirror, | ||
| 25 | } Transformation; | ||
| 26 | |||
| 27 | void print_transformation(Transformation t); | ||
| 28 | |||
| 29 | Cube transform_cube(Transformation t, Cube cube); | ||
| 30 | void transform_alg(Transformation t, NissMove *alg); /* Applied in-place */ | ||
| 31 | |||
| 32 | void init_transformations(bool read, bool write); | ||
| 33 | |||
| 34 | #endif | ||
