aboutsummaryrefslogtreecommitdiff
path: root/src/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands.c')
-rw-r--r--src/commands.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/commands.c b/src/commands.c
index e704d7a..ed3d46a 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -410,9 +410,11 @@ static void
410scramble_exec(CommandArgs *args) 410scramble_exec(CommandArgs *args)
411{ 411{
412 Cube cube; 412 Cube cube;
413 CubeArray *arr;
413 Alg *scr, *ruf, *aux; 414 Alg *scr, *ruf, *aux;
414 int i, j, eo, ep, co, cp, a[12]; 415 int i, j, eo, ep, co, cp, a[12];
415 uint64_t ui, uj; 416 int eparr[12] = { [8] = 8, [9] = 9, [10] = 10, [11] = 11 };
417 uint64_t ui, uj, uk;
416 418
417 init_all_movesets(); 419 init_all_movesets();
418 init_symcoord(); 420 init_symcoord();
@@ -429,17 +431,29 @@ scramble_exec(CommandArgs *args)
429 * Moreover we again need to fix parity after * 431 * Moreover we again need to fix parity after *
430 * generating epose manually */ 432 * generating epose manually */
431 do { 433 do {
432 ui = rand() % coord_drudfin_noE_sym16.max; 434 ui = rand() % FACTORIAL8;
433 uj = rand() % FACTORIAL4; 435 uj = rand() % FACTORIAL8;
434 cube = coord_drudfin_noE_sym16.cube(ui); 436 uk = rand() % FACTORIAL4;
435 cube.epose += uj; 437
438 index_to_perm(ui, 12, a);
439 arr = malloc(sizeof(CubeArray));
440 arr->ep = eparr;
441 cube = arrays_to_cube(arr, pf_ep);
442 free(arr);
443
444 cube.cp = uj;
445 cube.epose += uk;
436 } while (!is_admissible(cube)); 446 } while (!is_admissible(cube));
437 } else if (!strcmp(args->scrtype, "htr")) { 447 } else if (!strcmp(args->scrtype, "htr")) {
438 /* antindex_htrfin() returns a consistent * 448 /* antindex_htrfin() returns a consistent *
439 * cube, except possibly for parity */ 449 * cube, except possibly for parity */
440 do { 450 do {
441 ui = rand() % coord_htrfin.max; 451 ui = rand() % (24*24/6);
442 cube = coord_htrfin.cube(ui); 452 cube = (Cube){0};
453 cube.cp = cornershtrfin_ant[ui];
454 cube.epose = rand() % 24;
455 cube.eposs = rand() % 24;
456 cube.eposm = rand() % 24;
443 } while (!is_admissible(cube)); 457 } while (!is_admissible(cube));
444 } else { 458 } else {
445 eo = rand() % POW2TO11; 459 eo = rand() % POW2TO11;

Generated with cgit - Back to sebastiano.tronto.net