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