From 40c1aedcd2c8b770ea07ebf7fc22e83ec4b30cb3 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 3 Dec 2021 13:41:24 +0100 Subject: Some attempts at using the inverse scramble to get more info for pruning (optimal solving) --- src/cube.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/cube.c') diff --git a/src/cube.c b/src/cube.c index 056e571..4e038c7 100644 --- a/src/cube.c +++ b/src/cube.c @@ -5,7 +5,7 @@ int array_ep_to_epos(int *ep, int *ss) { - int epos[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + int epos[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int eps[4]; int i, j, is; @@ -287,11 +287,15 @@ equal(Cube c1, Cube c2) Cube inverse_cube(Cube cube) { - CubeArray *arr = new_cubearray(cube, pf_all); - CubeArray *inv = new_cubearray((Cube){0}, pf_all); + CubeArray *arr, *inv; Cube ret; int i; + arr = new_cubearray((Cube){0}, pf_all); + inv = new_cubearray((Cube){0}, pf_all); + + cube_to_arrays(cube, arr, pf_all); + for (i = 0; i < 12; i++) { inv->ep[arr->ep[i]] = i; inv->eofb[arr->ep[i]] = arr->eofb[i]; @@ -317,8 +321,8 @@ inverse_cube(Cube cube) } bool -is_admissible(Cube cube) -{ +is_admissible(Cube cube) { + /* TODO: this should check consistency of different orientations */ /* check also that centers are opposite and admissible */ -- cgit v1.3