Project

General

Profile

« Previous | Next » 

Revision e9bff328

Added by Leszek Koltunski about 1 year ago

Progess with Skewb solver.

View differences:

src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
28 28
  CUBE2    (ObjectSignatures.CUBE_2, TBCube2.class),
29 29
  MIRR2    (ObjectSignatures.MIRR_2, TBCube2.class),
30 30
  JING2    (ObjectSignatures.JING_2, TBJing.class),
31
  SKEW2    (ObjectSignatures.SKEW_2, TBSkewb.class),
31 32
  ;
32 33

  
33 34
  public static final int NUM_OBJECTS = values().length;
src/main/java/org/distorted/objectlib/tablebases/TBSkewb.java
1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2023 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

  
10
package org.distorted.objectlib.tablebases;
11

  
12
import static org.distorted.objectlib.main.TwistyObject.SQ3;
13

  
14
import android.content.res.Resources;
15

  
16
import org.distorted.library.type.Static3D;
17
import org.distorted.objectlib.R;
18

  
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

  
21
public class TBSkewb extends TablebasesAbstract
22
{
23
  public TBSkewb()
24
    {
25
    super();
26
    }
27

  
28
///////////////////////////////////////////////////////////////////////////////////////////////////
29

  
30
  public TBSkewb(Resources res)
31
    {
32
    super(res, R.raw.pyra_3_tablebase);
33
    }
34

  
35
///////////////////////////////////////////////////////////////////////////////////////////////////
36

  
37
  int[][] getBasicAngles()
38
    {
39
    int[] tmp = {3,3};
40
    return new int[][] { tmp,tmp,tmp,tmp };
41
    }
42

  
43
///////////////////////////////////////////////////////////////////////////////////////////////////
44

  
45
  Static3D[] getRotationAxis()
46
    {
47
    return new Static3D[]
48
         {
49
           new Static3D( SQ3/3, SQ3/3, SQ3/3),
50
           new Static3D( SQ3/3, SQ3/3,-SQ3/3),
51
           new Static3D( SQ3/3,-SQ3/3, SQ3/3),
52
           new Static3D( SQ3/3,-SQ3/3,-SQ3/3)
53
         };
54
    }
55

  
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57

  
58
  float[][] getPosition()
59
    {
60
    return new float[][]
61
         {
62
             { 1, 1, 1 },
63
             { 1, 1,-1 },
64
             { 1,-1, 1 },
65
             { 1,-1,-1 },
66
             {-1, 1, 1 },
67
             {-1, 1,-1 },
68
             {-1,-1, 1 },
69
             {-1,-1,-1 },
70

  
71
             { 0, 0, 1 },
72
             { 0, 0,-1 },
73
             { 0, 1, 0 },
74
             { 0,-1, 0 },
75
             { 1, 0, 0 },
76
             {-1, 0, 0 }
77
         };
78
    }
79

  
80
///////////////////////////////////////////////////////////////////////////////////////////////////
81

  
82
  float[][] getCuts()
83
    {
84
    float[] cut = {0};
85
    return new float[][] { cut,cut,cut,cut };
86
    }
87

  
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89

  
90
  boolean[][] getRotatable()
91
    {
92
    boolean[] t1 = new boolean[] {false,true};
93
    boolean[] t2 = new boolean[] {true,false};
94
    return new boolean[][] { t1,t2,t2,t1 };
95
    }
96

  
97
///////////////////////////////////////////////////////////////////////////////////////////////////
98
// specifically for the tablebase
99
///////////////////////////////////////////////////////////////////////////////////////////////////
100

  
101
  int getSize()
102
    {
103
    return 3149280;  // see https://www.jaapsch.net/puzzles/skewb.htm
104
    }
105

  
106
///////////////////////////////////////////////////////////////////////////////////////////////////
107

  
108
  int getMinScramble()
109
    {
110
    return 9;
111
    }
112

  
113
///////////////////////////////////////////////////////////////////////////////////////////////////
114

  
115
  public int[] getQuats(int index)
116
    {
117
    return null;
118
    }
119

  
120
///////////////////////////////////////////////////////////////////////////////////////////////////
121

  
122
  public int getIndex(int[] quats)
123
    {
124
    return 0;
125
    }
126
}  
127

  

Also available in: Unified diff