commit 277401c083e03f20f868ae7a2c8bf645be67e349
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Feb 18 00:16:58 2023 +0100

    Pyraminx Duo solver: solutions (coming from unpacked DB recreated each time) seem to be working.

diff --git a/src/main/java/org/distorted/screens/RubikScreenSolution.java b/src/main/java/org/distorted/screens/RubikScreenSolution.java
index 60d8324c..bacfba7d 100644
--- a/src/main/java/org/distorted/screens/RubikScreenSolution.java
+++ b/src/main/java/org/distorted/screens/RubikScreenSolution.java
@@ -262,6 +262,18 @@ public class RubikScreenSolution extends RubikScreenAbstract implements MovesFin
     mMovesText.setText(act.getString(R.string.mo_placeholder,mCurrMove,mNumMoves));
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  void setupMoves(final RubikActivity act, int[][] moves)
+    {
+    mCanRotate= true;
+    mCurrMove = 0;
+    mNumMoves = moves==null ? 0 : moves.length;
+    mMoves    = moves;
+
+    mMovesText.setText(act.getString(R.string.mo_placeholder,mCurrMove,mNumMoves));
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void savePreferences(SharedPreferences.Editor editor)
diff --git a/src/main/java/org/distorted/screens/RubikScreenSolver.java b/src/main/java/org/distorted/screens/RubikScreenSolver.java
index b79285d4..9c810b44 100644
--- a/src/main/java/org/distorted/screens/RubikScreenSolver.java
+++ b/src/main/java/org/distorted/screens/RubikScreenSolver.java
@@ -348,6 +348,28 @@ public class RubikScreenSolver extends RubikScreenAbstract
       }
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setSolved(final int[][] moves)
+    {
+    mSolving = false;
+    final RubikActivity act = mWeakAct.get();
+
+    if( act!=null )
+      {
+      act.runOnUiThread(new Runnable()
+        {
+        @Override
+        public void run()
+          {
+          ScreenList.switchScreen(act, ScreenList.SOLU);
+          RubikScreenSolution solution = (RubikScreenSolution) ScreenList.SOLU.getScreenClass();
+          solution.setupMoves(act, moves);
+          }
+        });
+      }
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void displayErrorDialog(String message)
diff --git a/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java b/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
index e569fc4f..21b1d473 100644
--- a/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
+++ b/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
@@ -34,7 +34,6 @@ public class SolverPyraminxDuo extends SolverTablebase
 
   private static final int ERROR_CORNERS_CANNOT   = -11;
 
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   private boolean cornerEqual(int[] corner, int c1, int c2, int c3)
@@ -281,12 +280,11 @@ public class SolverPyraminxDuo extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public String solution(int index, Resources res)
+  public int[][] solution(int index, Resources res)
     {
     TablebasesPyraminxDuo tb = new TablebasesPyraminxDuo();
     tb.createTablebase();
-
-    return "";
+    return tb.solution(index);
     }
 }  
 
diff --git a/src/main/java/org/distorted/solvers/SolverTablebase.java b/src/main/java/org/distorted/solvers/SolverTablebase.java
index b3665967..43963739 100644
--- a/src/main/java/org/distorted/solvers/SolverTablebase.java
+++ b/src/main/java/org/distorted/solvers/SolverTablebase.java
@@ -25,7 +25,7 @@ public abstract class SolverTablebase
 
   public abstract int tablebaseIndex(TwistyObject object);
   public abstract String error(int index, Resources res);
-  public abstract String solution(int index, Resources res);
+  public abstract int[][] solution(int index, Resources res);
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
@@ -39,21 +39,19 @@ public abstract class SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void solve(RubikScreenSolver solver)
+  public void solve(RubikScreenSolver screen)
     {
-    String result;
-
     int index = tablebaseIndex(mObject);
 
     if( index>=0 )
       {
-      result = solution(index,mRes);
-      solver.setSolved(result);
+      int[][] moves = solution(index,mRes);
+      screen.setSolved(moves);
       }
     else
       {
       String error = error(index,mRes);
-      solver.displayErrorDialog(error);
+      screen.displayErrorDialog(error);
       }
     }
 }  
