aboutsummaryrefslogtreecommitdiff
path: root/src/cube.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cube.c14
1 files changed, 9 insertions, 5 deletions
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 @@
5int 5int
6array_ep_to_epos(int *ep, int *ss) 6array_ep_to_epos(int *ep, int *ss)
7{ 7{
8 int epos[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 8 int epos[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
9 int eps[4]; 9 int eps[4];
10 int i, j, is; 10 int i, j, is;
11 11
@@ -287,11 +287,15 @@ equal(Cube c1, Cube c2)
287Cube 287Cube
288inverse_cube(Cube cube) 288inverse_cube(Cube cube)
289{ 289{
290 CubeArray *arr = new_cubearray(cube, pf_all); 290 CubeArray *arr, *inv;
291 CubeArray *inv = new_cubearray((Cube){0}, pf_all);
292 Cube ret; 291 Cube ret;
293 int i; 292 int i;
294 293
294 arr = new_cubearray((Cube){0}, pf_all);
295 inv = new_cubearray((Cube){0}, pf_all);
296
297 cube_to_arrays(cube, arr, pf_all);
298
295 for (i = 0; i < 12; i++) { 299 for (i = 0; i < 12; i++) {
296 inv->ep[arr->ep[i]] = i; 300 inv->ep[arr->ep[i]] = i;
297 inv->eofb[arr->ep[i]] = arr->eofb[i]; 301 inv->eofb[arr->ep[i]] = arr->eofb[i];
@@ -317,8 +321,8 @@ inverse_cube(Cube cube)
317} 321}
318 322
319bool 323bool
320is_admissible(Cube cube) 324is_admissible(Cube cube) {
321{ 325
322 /* TODO: this should check consistency of different orientations */ 326 /* TODO: this should check consistency of different orientations */
323 /* check also that centers are opposite and admissible */ 327 /* check also that centers are opposite and admissible */
324 328

Generated with cgit - Back to sebastiano.tronto.net