diff options
Diffstat (limited to 'old/2021-02-18-piecefilter/src/main.c')
| -rw-r--r-- | old/2021-02-18-piecefilter/src/main.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/old/2021-02-18-piecefilter/src/main.c b/old/2021-02-18-piecefilter/src/main.c new file mode 100644 index 0000000..0b5de2e --- /dev/null +++ b/old/2021-02-18-piecefilter/src/main.c | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include "cube.h" | ||
| 3 | #include "moves.h" | ||
| 4 | #include "solve.h" | ||
| 5 | |||
| 6 | int main() { | ||
| 7 | init_ttables(true, true); | ||
| 8 | init_aux_tables(); | ||
| 9 | |||
| 10 | |||
| 11 | char moves[100] = "MR U' B2 Bw F z xE2 M' x Dw' y Fw2 y2"; | ||
| 12 | NissMove alg[100]; | ||
| 13 | read_moves(moves, alg, 100); | ||
| 14 | Cube cube = apply_alg(alg, blank_cube()); | ||
| 15 | |||
| 16 | /*f_eofb(cube);*/ | ||
| 17 | |||
| 18 | |||
| 19 | /* NissMove sol[MAXS][MAXM];*/ | ||
| 20 | SolveData d = { .optimal_only = true, .available = standard_moveset, | ||
| 21 | .max_moves = 10, | ||
| 22 | .cleanup = true, | ||
| 23 | .max_solutions = 10, | ||
| 24 | .f = f_eofb }; | ||
| 25 | read_moves("y", d.pre_rotation, 2); | ||
| 26 | int n = solve(cube, &d); | ||
| 27 | printf("%d solutions found:\n", n); | ||
| 28 | for (int i = 0; i < n; i++) | ||
| 29 | print_moves(d.solutions[i]); | ||
| 30 | |||
| 31 | NissMove a[5], b[5]; | ||
| 32 | read_moves("R", a, 5); | ||
| 33 | read_moves("U", b, 5); | ||
| 34 | Cube c1 = apply_alg(a,blank_cube()), c2 = apply_alg(b,blank_cube()); | ||
| 35 | print_cube(compose(c2,c1)); | ||
| 36 | print_cube(compose(c1,c2)); | ||
| 37 | /*print_cube(compose(c2,blank_cube()));*/ | ||
| 38 | |||
| 39 | NissMove nm[10]; | ||
| 40 | read_moves("y(y)RU", nm, 10); | ||
| 41 | |||
| 42 | print_moves(nm); | ||
| 43 | cleanup(nm, 10); | ||
| 44 | print_moves(nm); | ||
| 45 | |||
| 46 | return 0; | ||
| 47 | } | ||
