aboutsummaryrefslogtreecommitdiff
path: root/old/2021-02-18-piecefilter/src/main.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 21:37:34 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 21:37:34 +0100
commit3568412f8f230774d0d11d7ed1c897424f95d3ef (patch)
tree77223792d8c925a9b1fc32b3f4341e943b5f8209 /old/2021-02-18-piecefilter/src/main.c
parent67e1b5e6e6a2c917a2fe58a37a1382c982b1e5c5 (diff)
downloadnissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.tar.gz
nissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.zip
Rewritten from scratch. Welocme nissy 2.0!
Diffstat (limited to 'old/2021-02-18-piecefilter/src/main.c')
-rw-r--r--old/2021-02-18-piecefilter/src/main.c47
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
6int 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}

Generated with cgit - Back to sebastiano.tronto.net