Project

General

Profile

Download (901 Bytes) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / solvers / cube3 / Color.java @ b95ceafc

1
package org.distorted.solvers.cube3;
2

    
3
//++++++++++++++++++++++++++++++ Names the colors of the cube facelets ++++++++++++++++++++++++++++++++++++++++++++++++
4

    
5
class Color
6
  {
7
  public static final int U=0;
8
  public static final int R=1;
9
  public static final int F=2;
10
  public static final int D=3;
11
  public static final int L=4;
12
  public static final int B=5;
13

    
14
  public static String toString(int i)
15
    {
16
    switch(i)
17
      {
18
      case U: return "U";
19
      case R: return "R";
20
      case F: return "F";
21
      case D: return "D";
22
      case L: return "L";
23
      case B: return "B";
24
      default: return "?";
25
      }
26
    }
27
  
28
  public static int toInt(String s)
29
    {
30
	switch(s.charAt(0))
31
      {
32
      case 'U': return U;
33
      case 'R': return R;
34
      case 'F': return F;
35
      case 'D': return D;
36
      case 'L': return L;
37
      case 'B': return B;
38
      default: return -1;
39
      }  
40
    }
41
  }
(1-1/9)