Project

General

Profile

« Previous | Next » 

Revision 68b59ec3

Added by Leszek Koltunski about 1 year ago

CU_323 solver: progress

View differences:

src/main/java/org/distorted/objectlib/tablebases/TBCuboid323.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 org.distorted.library.type.Static3D;
13
import org.distorted.objectlib.helpers.OperatingSystemInterface;
14

  
15
///////////////////////////////////////////////////////////////////////////////////////////////////
16

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

  
24
///////////////////////////////////////////////////////////////////////////////////////////////////
25

  
26
  public TBCuboid323(OperatingSystemInterface os)
27
    {
28
    super(os,org.distorted.objectlib.R.raw.cu_232_tablebase);
29
    }
30

  
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32

  
33
  int[][] getBasicAngles()
34
    {
35
    int[] tmp2 = {2,2};
36
    int[] tmp4 = {4,4,4};
37
    return new int[][] { tmp2,tmp4,tmp2 };
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
        { -1.0f, -0.5f, -1.0f },
59
        { -1.0f, -0.5f,  1.0f },
60
        { -1.0f,  0.5f, -1.0f },
61
        { -1.0f,  0.5f,  1.0f },
62
        {  1.0f, -0.5f, -1.0f },
63
        {  1.0f, -0.5f,  1.0f },
64
        {  1.0f,  0.5f, -1.0f },
65
        {  1.0f,  0.5f,  1.0f },
66

  
67
        {  0.0f, -0.5f, -1.0f },
68
        {  0.0f, -0.5f,  1.0f },
69
        {  0.0f,  0.5f, -1.0f },
70
        {  0.0f,  0.5f,  1.0f },
71
        { -1.0f, -0.5f,  0.0f },
72
        { -1.0f,  0.5f,  0.0f },
73
        {  1.0f, -0.5f,  0.0f },
74
        {  1.0f,  0.5f,  0.0f },
75

  
76
        {  0.0f,  0.5f,  0.0f },
77
        {  0.0f, -0.5f,  0.0f },
78
      };
79
    }
80

  
81
///////////////////////////////////////////////////////////////////////////////////////////////////
82

  
83
  float[][] getCuts()
84
    {
85
    return new float[][] { {-0.5f,0.5f}, {0.0f}, {-0.5f,0.5f} };
86
    }
87

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

  
90
  boolean[][] getRotatable()
91
    {
92
    return new boolean[][] { {true,false,true},{true,false},{true,false,true} };
93
    }
94

  
95
///////////////////////////////////////////////////////////////////////////////////////////////////
96
// specifically for the tablebase
97
///////////////////////////////////////////////////////////////////////////////////////////////////
98
// 8!*8!/4 --> https://www.jaapsch.net/puzzles/domino.htm
99

  
100
  int getSize()
101
    {
102
    return 406425600;
103
    }
104

  
105
///////////////////////////////////////////////////////////////////////////////////////////////////
106

  
107
  int getMinScramble()
108
    {
109
    return 13;
110
    }
111

  
112
///////////////////////////////////////////////////////////////////////////////////////////////////
113

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

  
119
///////////////////////////////////////////////////////////////////////////////////////////////////
120

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

  
src/main/java/org/distorted/objectlib/tablebases/TablebaseHelpers.java
18 18

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

  
21
  static void displayTable(int[] table, String marker)
21
  public static void displayTable(int[] table, String marker)
22 22
    {
23 23
    StringBuilder sb = new StringBuilder();
24 24

  

Also available in: Unified diff