aboutsummaryrefslogtreecommitdiff
path: root/old/2021-06-15-before-separating-steps/main.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 22:05:00 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 22:05:00 +0100
commit4fb67201414169a2687f41c4056b2e284b4938cb (patch)
treea68246e3e21435229541f83f485ab41cfb2ba08a /old/2021-06-15-before-separating-steps/main.c
parent3568412f8f230774d0d11d7ed1c897424f95d3ef (diff)
downloadnissy-4fb67201414169a2687f41c4056b2e284b4938cb.tar.gz
nissy-4fb67201414169a2687f41c4056b2e284b4938cb.zip
Removed old files
Diffstat (limited to 'old/2021-06-15-before-separating-steps/main.c')
-rw-r--r--old/2021-06-15-before-separating-steps/main.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/old/2021-06-15-before-separating-steps/main.c b/old/2021-06-15-before-separating-steps/main.c
deleted file mode 100644
index ff726b5..0000000
--- a/old/2021-06-15-before-separating-steps/main.c
+++ /dev/null
@@ -1,60 +0,0 @@
1#include <stdio.h>
2#include "cube.h"
3
4int main() {
5 Alg *algo;
6 AlgList *sols;
7 Cube cube;
8 SolveOptions opts;
9 char line[1000];
10 int i, ns = 2, nrand = 100000, sum1, sum2;
11
12 Step *stps[20] = {&drud_HTM, &optimal_HTM};
13 char sss[30][30] = {"DR on U/D", "Optimal solution"};
14
15 opts = (SolveOptions) {
16 .min_moves = 0,
17 .max_moves = 20,
18 .optimal_only = true,
19 .max_solutions = 1,
20 .can_niss = false,
21 .feedback = true
22 };
23
24 init();
25
26/*
27 print_ptable(&pd_drud_HTM);
28 print_ptable(&pd_ep_HTM);
29 print_ptable(&pd_corners_HTM);
30*/
31
32 srand(time(NULL));
33 sum1 = 0;
34 sum2 = 0;
35 for (i = 0; i < nrand; i++) {
36 sum1 += optimal_HTM.check(random_cube());
37 sum2 += corners_HTM.check(random_cube());
38 }
39 printf("Average optimal pruning: %lf\n", ((double)sum1) / ((double) nrand));
40 printf("Average corners pruning: %lf\n", ((double)sum2) / ((double) nrand));
41
42 printf("Welcome to nissy 2.0! Insert a scramble:\n");
43
44 if (fgets(line, 1000, stdin) != NULL) {
45 algo = new_alg(line);
46 cube = apply_alg(algo, (Cube){0});
47
48 for (i = 0; i < ns; i++) {
49 if (stps[i]->check == NULL)
50 fprintf(stderr, "Check function for step %d is null\n", i);
51 sols = solve(cube, *stps[i], &opts);
52 printf("%s: %d solutions found:\n", sss[i], sols->len);
53 print_alglist(sols, true);
54 free_alglist(sols);
55 }
56 free(algo);
57 }
58
59 return 0;
60}

Generated with cgit - Back to sebastiano.tronto.net