aboutsummaryrefslogtreecommitdiff
path: root/old/2021-07-15-almostbeforerefactor/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-07-15-almostbeforerefactor/main.c
parent3568412f8f230774d0d11d7ed1c897424f95d3ef (diff)
downloadnissy-4fb67201414169a2687f41c4056b2e284b4938cb.tar.gz
nissy-4fb67201414169a2687f41c4056b2e284b4938cb.zip
Removed old files
Diffstat (limited to '')
-rw-r--r--old/2021-07-15-almostbeforerefactor/main.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/old/2021-07-15-almostbeforerefactor/main.c b/old/2021-07-15-almostbeforerefactor/main.c
deleted file mode 100644
index 482e007..0000000
--- a/old/2021-07-15-almostbeforerefactor/main.c
+++ /dev/null
@@ -1,60 +0,0 @@
1#include <stdio.h>
2#include "cube.h"
3#include "steps.h"
4
5int main() {
6 Alg *algo;
7 AlgList *sols;
8 Cube cube;
9 SolveOptions opts;
10 char line[1000];
11 int i, ns = 1;
12/* Move m;*/
13/* int nrand = 10000, sum1, sum2;*/
14
15 Step *stps[20] = {&optimal_HTM};
16 char sss[30][30] = {"Optimal solve"};
17
18 opts = (SolveOptions) {
19 .min_moves = 0,
20 .max_moves = 20,
21 .optimal_only = true,
22 .max_solutions = 1,
23 .can_niss = false,
24 .feedback = true,
25 };
26
27 init();
28
29/*
30 srand(time(NULL));
31 sum1 = 0;
32 sum2 = 0;
33 for (i = 0; i < nrand; i++) {
34 cube = random_cube();
35 sum1 += drud_HTM.estimate((CubeTarget){.cube = cube, .target = 20});
36 sum2 += optimal_HTM.estimate((CubeTarget){.cube = cube, .target = 20});
37 }
38 printf("Average drud pruning: %lf\n", ((double)sum1) / ((double) nrand));
39 printf("Average corners htr pruning: %lf\n", ((double)sum2) / ((double) nrand));
40*/
41
42
43 printf("Welcome to nissy 2.0! Insert a scramble:\n");
44
45 if (fgets(line, 1000, stdin) != NULL) {
46 algo = new_alg(line);
47 cube = apply_alg(algo, (Cube){0});
48
49 for (i = 0; i < ns; i++) {
50 sols = solve(cube, *stps[i], &opts);
51 printf("%s: %d solutions found:\n", sss[i], sols->len);
52 print_alglist(sols, true);
53 free_alglist(sols);
54 }
55 free_alg(algo);
56 }
57
58 return 0;
59}
60

Generated with cgit - Back to sebastiano.tronto.net