diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-14 16:55:15 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-14 16:55:15 +0200 |
| commit | 87de946c47b3b5ef0fb0c5f2289bb033bc8d9038 (patch) | |
| tree | 3836b9cfa607258b506822a5691e7e6b2f7bd7cb /tools/300_solve_small | |
| parent | ebe1ef1d2d63c245fb203878d8309f1808d75c42 (diff) | |
| download | nissy-core-87de946c47b3b5ef0fb0c5f2289bb033bc8d9038.tar.gz nissy-core-87de946c47b3b5ef0fb0c5f2289bb033bc8d9038.zip | |
Fix solvers for k = 2, and changes to solve tool
Diffstat (limited to 'tools/300_solve_small')
| -rw-r--r-- | tools/300_solve_small/solve_small.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/300_solve_small/solve_small.c b/tools/300_solve_small/solve_small.c index 622c36e..374d11a 100644 --- a/tools/300_solve_small/solve_small.c +++ b/tools/300_solve_small/solve_small.c | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | #define SOL_BUFFER_LEN 1000 | 3 | #define SOL_BUFFER_LEN 1000 |
| 4 | 4 | ||
| 5 | const char *solver = "h48h0k4"; | 5 | char *solver; |
| 6 | int64_t size = 0; | 6 | int64_t size = 0; |
| 7 | char *buf; | 7 | char *buf; |
| 8 | 8 | ||
| 9 | char *scrambles[] = { | 9 | char *scrambles[] = { |
| 10 | "R D' R2 D R U2 R' D' R U2 R D R'", /* 12 optimal */ | 10 | //"R D' R2 D R U2 R' D' R U2 R D R'", /* 12 optimal */ |
| 11 | "RLUD RLUD RLUD", /* 12 optimal */ | 11 | //"RLUD RLUD RLUD", /* 12 optimal */ |
| 12 | "R' U' F D2 L2 F R2 U2 R2 B D2 L B2 D' B2 L' R' B D2 B U2 L U2 R' U' F", /* FMC2019 A1 - 16 optimal */ | 12 | "R' U' F D2 L2 F R2 U2 R2 B D2 L B2 D' B2 L' R' B D2 B U2 L U2 R' U' F", /* FMC2019 A1 - 16 optimal */ |
| 13 | // "R' U' F D R F2 D L F D2 F2 L' U R' L2 D' R2 F2 R2 D L2 U2 R' U' F", /* FMC2024 A1 - 19 optimal */ | 13 | // "R' U' F D R F2 D L F D2 F2 L' U R' L2 D' R2 F2 R2 D L2 U2 R' U' F", /* FMC2024 A1 - 19 optimal */ |
| 14 | NULL | 14 | NULL |
| @@ -37,12 +37,20 @@ void run(void) { | |||
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | int main(void) { | 40 | int main(int argc, char **argv) { |
| 41 | char filename[255]; | 41 | char filename[255]; |
| 42 | 42 | ||
| 43 | if (argc < 2) { | ||
| 44 | printf("Error: not enough arguments. " | ||
| 45 | "A solver must be given.\n"); | ||
| 46 | return 1; | ||
| 47 | } | ||
| 48 | |||
| 49 | solver = argv[1]; | ||
| 43 | srand(time(NULL)); | 50 | srand(time(NULL)); |
| 44 | nissy_setlogger(log_stderr); | 51 | nissy_setlogger(log_stderr); |
| 45 | 52 | ||
| 53 | |||
| 46 | sprintf(filename, "tables/%s", solver); | 54 | sprintf(filename, "tables/%s", solver); |
| 47 | if (getdata(solver, &buf, filename) != 0) | 55 | if (getdata(solver, &buf, filename) != 0) |
| 48 | return 1; | 56 | return 1; |
