commit 08a8ebc722d8e6c03ee541b968b06e4be5a77f6b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Feb 24 00:55:28 2023 +0100

    CU_232 solver: beginnings of the solver class.

diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java b/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
index 4e5f7e8c..d76a2183 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
@@ -33,7 +33,7 @@ import org.distorted.objectlib.shape.ShapeHexahedron;
 
 public class TwistyCuboid extends ShapeHexahedron
 {
-  static final Static3D[] ROT_AXIS = new Static3D[]
+  public static final Static3D[] ROT_AXIS = new Static3D[]
          {
            new Static3D(1,0,0),
            new Static3D(0,1,0),
diff --git a/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java b/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
index 48f783de..f286fe1e 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
@@ -22,6 +22,7 @@ public enum ImplementedTablebasesList
 {
   PYRAMINX_DUO  (ObjectType.PDUO_2, TablebasesPyraminxDuo.class),
   IVY_CUBE      (ObjectType.IVY_2 , TablebasesIvyCube.class),
+  CU_232        (ObjectType.CU_232, TablebasesCuboid232.class),
   ;
 
   public static final int NUM_OBJECTS = values().length;
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TablebasesCuboid232.java b/src/main/java/org/distorted/objectlib/tablebases/TablebasesCuboid232.java
new file mode 100644
index 00000000..97aace0b
--- /dev/null
+++ b/src/main/java/org/distorted/objectlib/tablebases/TablebasesCuboid232.java
@@ -0,0 +1,194 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2023 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is proprietary software licensed under an EULA which you should have received      //
+// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.objectlib.tablebases;
+
+import android.content.res.Resources;
+
+import org.distorted.library.type.Static3D;
+import org.distorted.objectlib.objects.TwistyCuboid;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class TablebasesCuboid232 extends TablebasesAbstract
+{
+  public TablebasesCuboid232()
+    {
+    super();
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public TablebasesCuboid232(Resources res)
+    {
+    super(res,org.distorted.objectlib.R.raw.ivy_2_tablebase);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  int[][] getBasicAngles()
+    {
+    int[] tmp2 = {2,2};
+    int[] tmp4 = {4,4,4};
+    return new int[][] { tmp2,tmp4,tmp2 };
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  Static3D[] getRotationAxis()
+    {
+    return TwistyCuboid.ROT_AXIS;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  float[][] getPosition()
+    {
+    return new float[][]
+      {
+        { -0.5f, -1.0f, -0.5f },
+        { -0.5f, -1.0f,  0.5f },
+        { -0.5f,  1.0f, -0.5f },
+        { -0.5f,  1.0f,  0.5f },
+        {  0.5f, -1.0f, -0.5f },
+        {  0.5f, -1.0f,  0.5f },
+        {  0.5f,  1.0f, -0.5f },
+        {  0.5f,  1.0f,  0.5f },
+
+        { -0.5f,  0.0f, -0.5f },
+        { -0.5f,  0.0f,  0.5f },
+        {  0.5f,  0.0f, -0.5f },
+        {  0.5f,  0.0f,  0.5f },
+      };
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  float[][] getCuts()
+    {
+    return new float[][] { {0.0f}, {-0.5f,0.5f}, {0.0f} };
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  boolean[][] getRotatable()
+    {
+    return new boolean[][] { {false,true},{true,false,true},{true,false} };
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// specifically for the tablebase
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// 8!*3! --> https://www.jaapsch.net/puzzles/cube223.htm
+
+  int getSize()
+    {
+    return 241920;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void getCornerQuats(int[] output, int[] perm)
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void getEdgeQuats(int[] output, int[] perm)
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int[] getCornerPerm(int[] quats)
+    {
+    return null;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int[] getEdgePerm(int[] quats)
+    {
+    return null;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int[] uncollapseEdgePerm(int[] perm)
+    {
+    int[] ret = new int[4];
+
+    ret[0] = perm[0];
+    ret[1] = 1;
+    ret[2] = perm[1];
+    ret[3] = perm[2];
+
+    if( ret[0]>=1 ) ret[0]++;
+    if( ret[2]>=1 ) ret[2]++;
+    if( ret[3]>=1 ) ret[3]++;
+
+    return ret;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int[] getQuats(int index)
+    {
+    int[] quats = new int[12];
+
+    int edge_perm_num = index%6;
+    int corn_perm_num = index/6;
+
+    int[] edge_perm = new int[3];
+    TablebaseHelpers.getPermutationFromNum(edge_perm,3,edge_perm_num);
+
+    int[] corn_perm = new int[8];
+    TablebaseHelpers.getPermutationFromNum(corn_perm,8,corn_perm_num);
+
+    int[] edge_perm2 = uncollapseEdgePerm(edge_perm);
+    getCornerQuats(quats,corn_perm);
+    getEdgeQuats(quats,edge_perm2);
+
+    return quats;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int[] collapseEdgePerm(int[] perm)
+    {
+    int[] ret = new int[3];
+
+    ret[0] = perm[0];
+    ret[1] = perm[2];
+    ret[2] = perm[3];
+
+    if( ret[0]>1 ) ret[0]--;
+    if( ret[1]>1 ) ret[1]--;
+    if( ret[2]>1 ) ret[2]--;
+
+    return ret;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getIndex(int[] quats)
+    {
+    int[] edge_perm = getEdgePerm(quats);
+    int[] corn_perm = getCornerPerm(quats);
+    int[] edge_perm2= collapseEdgePerm(edge_perm); // edge1 is fixed!
+
+    int corn_perm_num = TablebaseHelpers.computePermutationNum(corn_perm);
+    int edge_perm_num = TablebaseHelpers.computePermutationNum(edge_perm2);
+
+    return edge_perm_num + 6*corn_perm_num;
+    }
+}  
+
