aboutsummaryrefslogtreecommitdiff
path: root/tools/300_solve_small
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-10 14:30:39 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-10 14:30:39 +0200
commitf8d247c53c3c3bd94fed645b5b47a9096cadc123 (patch)
tree7a62cc7322ea8175a7df9b655d4a9d5e026a004a /tools/300_solve_small
parent2e93de4ad102973961cb24d5b91f0c299763299f (diff)
downloadnissy-core-f8d247c53c3c3bd94fed645b5b47a9096cadc123.tar.gz
nissy-core-f8d247c53c3c3bd94fed645b5b47a9096cadc123.zip
Removed "options" from solver selection
Now the solver name fully determines the solver (and options) to be used. For example, now one must specify "h48h0k4" as the name of the solver. This PR also fixes a couple of things in tools.
Diffstat (limited to 'tools/300_solve_small')
-rw-r--r--tools/300_solve_small/solve_small.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/300_solve_small/solve_small.c b/tools/300_solve_small/solve_small.c
index b572cf5..ade949a 100644
--- a/tools/300_solve_small/solve_small.c
+++ b/tools/300_solve_small/solve_small.c
@@ -1,8 +1,6 @@
1#include "../tool.h" 1#include "../tool.h"
2 2
3const char *solver = "h48"; 3const char *solver = "h48h0k4";
4const char *options = "0;4;20";
5const char *filename = "tables/h48h0k4";
6char *buf; 4char *buf;
7 5
8char *scrambles[] = { 6char *scrambles[] = {
@@ -28,7 +26,7 @@ void run(void) {
28 continue; 26 continue;
29 } 27 }
30 n = nissy_solve( 28 n = nissy_solve(
31 cube, "h48", options, "", 0, 20, 1, -1, buf, sol); 29 cube, solver, "", 0, 20, 1, -1, buf, sol);
32 if (n == 0) { 30 if (n == 0) {
33 printf("No solution\n"); 31 printf("No solution\n");
34 fprintf(stderr, "No solution found\n"); 32 fprintf(stderr, "No solution found\n");
@@ -39,10 +37,13 @@ void run(void) {
39} 37}
40 38
41int main(void) { 39int main(void) {
40 char filename[255];
41
42 srand(time(NULL)); 42 srand(time(NULL));
43 nissy_setlogger(log_stderr); 43 nissy_setlogger(log_stderr);
44 44
45 if (getdata(solver, options, &buf, filename) != 0) 45 sprintf(filename, "tables/%s", solver);
46 if (getdata(solver, &buf, filename) != 0)
46 return 1; 47 return 1;
47 48
48 timerun(run); 49 timerun(run);

Generated with cgit - Back to sebastiano.tronto.net