Project

General

Profile

« Previous | Next » 

Revision 277401c0

Added by Leszek Koltunski over 1 year ago

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

View differences:

src/main/java/org/distorted/solvers/SolverTablebase.java
25 25

  
26 26
  public abstract int tablebaseIndex(TwistyObject object);
27 27
  public abstract String error(int index, Resources res);
28
  public abstract String solution(int index, Resources res);
28
  public abstract int[][] solution(int index, Resources res);
29 29

  
30 30
///////////////////////////////////////////////////////////////////////////////////////////////////
31 31
// PUBLIC API
......
39 39

  
40 40
///////////////////////////////////////////////////////////////////////////////////////////////////
41 41

  
42
  public void solve(RubikScreenSolver solver)
42
  public void solve(RubikScreenSolver screen)
43 43
    {
44
    String result;
45

  
46 44
    int index = tablebaseIndex(mObject);
47 45

  
48 46
    if( index>=0 )
49 47
      {
50
      result = solution(index,mRes);
51
      solver.setSolved(result);
48
      int[][] moves = solution(index,mRes);
49
      screen.setSolved(moves);
52 50
      }
53 51
    else
54 52
      {
55 53
      String error = error(index,mRes);
56
      solver.displayErrorDialog(error);
54
      screen.displayErrorDialog(error);
57 55
      }
58 56
    }
59 57
}  

Also available in: Unified diff