aboutsummaryrefslogtreecommitdiff
path: root/src/cube.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-13 17:13:24 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-13 17:13:24 +0100
commit1a90075f672a442cafa35c1cccbb6cf026c3980e (patch)
tree6b1b89477b984df3873806450f955770d0d850d2 /src/cube.c
parente864e23e3ec315d5969281c51f24521cde30792a (diff)
downloadnissy-1a90075f672a442cafa35c1cccbb6cf026c3980e.tar.gz
nissy-1a90075f672a442cafa35c1cccbb6cf026c3980e.zip
Fixed a problem with htr-drud coordinates. The corresponding pruning table also changed, hopefully the new one is correct.
Diffstat (limited to '')
-rw-r--r--src/cube.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/cube.c b/src/cube.c
index 06c8b8c..056e571 100644
--- a/src/cube.c
+++ b/src/cube.c
@@ -1,13 +1,8 @@
1#include "cube.h" 1#include "cube.h"
2 2
3/* Local functions **********************************************************/ 3/* Public functions implementation *******************************************/
4
5static int array_ep_to_epos(int *ep, int *eps_solved);
6static int epos_from_arrays(int *epos, int *ep);
7
8/* Local functions implementation ********************************************/
9 4
10static int 5int
11array_ep_to_epos(int *ep, int *ss) 6array_ep_to_epos(int *ep, int *ss)
12{ 7{
13 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 };
@@ -26,17 +21,9 @@ array_ep_to_epos(int *ep, int *ss)
26 for (i = 0; i < 4; i++) 21 for (i = 0; i < 4; i++)
27 swap(&epos[ss[i]], &epos[i+8]); 22 swap(&epos[ss[i]], &epos[i+8]);
28 23
29 return epos_from_arrays(epos, eps); 24 return 24 * subset_to_index(epos, 12, 4) + perm_to_index(eps, 4);
30} 25}
31 26
32static int
33epos_from_arrays(int *epos, int *ep)
34{
35 return FACTORIAL4 * subset_to_index(epos,12,4) + perm_to_index(ep,4);
36}
37
38/* Public functions implementation *******************************************/
39
40Cube 27Cube
41arrays_to_cube(CubeArray *arr, PieceFilter f) 28arrays_to_cube(CubeArray *arr, PieceFilter f)
42{ 29{

Generated with cgit - Back to sebastiano.tronto.net