Project

General

Profile

« Previous | Next » 

Revision 32b2e288

Added by Leszek Koltunski about 1 year ago

Skeleton Cube2 tablebases class.

View differences:

src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
25 25
  CU_232        (ObjectSignatures.CU_232, TablebasesCuboid232.class),
26 26
  PYRA_3        (ObjectSignatures.PYRA_3, TablebasesPyraminx.class),
27 27
  DIAMOND       (ObjectSignatures.DIAM_2, TablebasesSkewbDiamond.class),
28
  CUBE2         (ObjectSignatures.CUBE_2, TablebasesCube2.class),
28 29
  ;
29 30

  
30 31
  public static final int NUM_OBJECTS = values().length;
src/main/java/org/distorted/objectlib/tablebases/TablebasesCube2.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 android.content.res.Resources;
13

  
14
import org.distorted.library.type.Static3D;
15

  
16
///////////////////////////////////////////////////////////////////////////////////////////////////
17

  
18
public class TablebasesCube2 extends TablebasesAbstract
19
{
20
  public TablebasesCube2()
21
    {
22
    super();
23
    }
24

  
25
///////////////////////////////////////////////////////////////////////////////////////////////////
26

  
27
  public TablebasesCube2(Resources res)
28
    {
29
    super(res,org.distorted.objectlib.R.raw.cu_232_tablebase);
30
    }
31

  
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33

  
34
  int[][] getBasicAngles()
35
    {
36
    int[] tmp = {4,4};
37
    return new int[][] { tmp,tmp,tmp };
38
    }
39

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

  
42
  Static3D[] getRotationAxis()
43
    {
44
    return new Static3D[]
45
         {
46
           new Static3D(1,0,0),
47
           new Static3D(0,1,0),
48
           new Static3D(0,0,1)
49
         };
50
    }
51

  
52
///////////////////////////////////////////////////////////////////////////////////////////////////
53

  
54
  float[][] getPosition()
55
    {
56
    return new float[][]
57
      {
58
        { -0.5f, -0.5f, -0.5f },
59
        { -0.5f, -0.5f,  0.5f },
60
        { -0.5f,  0.5f, -0.5f },
61
        { -0.5f,  0.5f,  0.5f },
62
        {  0.5f, -0.5f, -0.5f },
63
        {  0.5f, -0.5f,  0.5f },
64
        {  0.5f,  0.5f, -0.5f },
65
        {  0.5f,  0.5f,  0.5f },
66
      };
67
    }
68

  
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70

  
71
  float[][] getCuts()
72
    {
73
    return new float[][] { {0.0f}, {0.0f}, {0.0f} };
74
    }
75

  
76
///////////////////////////////////////////////////////////////////////////////////////////////////
77

  
78
  boolean[][] getRotatable()
79
    {
80
    return new boolean[][] { {false,true},{false,true},{true,false} };
81
    }
82

  
83
///////////////////////////////////////////////////////////////////////////////////////////////////
84
// specifically for the tablebase
85
///////////////////////////////////////////////////////////////////////////////////////////////////
86
// 7!*3^6 --> https://www.jaapsch.net/puzzles/cube2.htm
87

  
88
  int getSize()
89
    {
90
    return 3674160;
91
    }
92

  
93
///////////////////////////////////////////////////////////////////////////////////////////////////
94

  
95
 int getMinScramble()
96
    {
97
    return 9;
98
    }
99

  
100
///////////////////////////////////////////////////////////////////////////////////////////////////
101

  
102
  public int[] getQuats(int index)
103
    {
104
    int[] quats = new int[8];
105

  
106
    return quats;
107
    }
108

  
109

  
110
///////////////////////////////////////////////////////////////////////////////////////////////////
111

  
112
  public int getIndex(int[] quats)
113
    {
114
    return 0;
115
    }
116
}  
117

  

Also available in: Unified diff