Project

General

Profile

Download (1.2 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / kociemba / SolverColor.java @ 3d022d6a

1
/*
2
 * Herbert Kociemba
3
 *
4
 * BSD-licensed. See https://opensource.org/licenses/BSD-3-Clause
5
 */
6

    
7
package org.distorted.objectlib.kociemba;
8

    
9
///////////////////////////////////////////////////////////////////////////////////////////////////
10
// Names the colors of the cube facelets
11

    
12
class SolverColor
13
  {
14
  public static final int U=0;
15
  public static final int R=1;
16
  public static final int F=2;
17
  public static final int D=3;
18
  public static final int L=4;
19
  public static final int B=5;
20

    
21
///////////////////////////////////////////////////////////////////////////////////////////////////
22

    
23
  public static String toString(int i)
24
    {
25
    switch(i)
26
      {
27
      case U: return "U";
28
      case R: return "R";
29
      case F: return "F";
30
      case D: return "D";
31
      case L: return "L";
32
      case B: return "B";
33
      default: return "?";
34
      }
35
    }
36

    
37
///////////////////////////////////////////////////////////////////////////////////////////////////
38

    
39
  public static int toInt(String s)
40
    {
41
	  switch(s.charAt(0))
42
      {
43
      case 'U': return U;
44
      case 'R': return R;
45
      case 'F': return F;
46
      case 'D': return D;
47
      case 'L': return L;
48
      case 'B': return B;
49
      default: return -1;
50
      }  
51
    }
52
  }
(1-1/8)