CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik.solver
Class KociembaCube

java.lang.Object
  extended by ch.randelshofer.rubik.solver.Cube
      extended by ch.randelshofer.rubik.solver.KociembaCube
All Implemented Interfaces:
java.lang.Cloneable

public class KociembaCube
extends Cube

Rubik's Cube class definition with extensions for Kociemba's algorithm This class has been derived from KociCube.cpp and KociCube.h from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.

Version:
0.0 2000-07-01
Author:
Werner Randelshofer, Hausmatt 10, CH-6045 Immensee, Switzerland

Field Summary
static int CHOICES
          12 choose 4 = 495.
static int CORNER_PERMUTATIONS
          8! = 40320.
static int FLIPS
          2^11 = 2048.
static int MIDDLE_SLICE_EDGE_PERMUTATIONS
          4! = 24 .
static int NON_MIDDLE_SLICE_EDGE_PERMUTATIONS
          8! = 40320.
static int TWISTS
          3^7 = 2187.
 
Fields inherited from class ch.randelshofer.rubik.solver.Cube
ANTI_QUARK, B, B2, BD, BDR, BI, BL, BLD, BR, BRU, BU, BUL, cornerCubieOrientations, cornerCubiePermutations, D, D2, DB, DBL, DF, DFR, DI, DL, DLF, DR, DRB, edgeCubieOrientations, edgeCubiePermutations, F, F2, FD, FDL, FI, FIRST_CORNER_CUBIE, FIRST_EDGE_CUBIE, FIRST_MIDDLE_SLICE_EDGE_CUBIE, FIRST_MOVE, FL, FLIPPED, FLU, FR, FRD, FU, FUR, INVALID_CUBIE, INVALID_MOVE, L, L2, LAST_CORNER_CUBIE, LAST_EDGE_CUBIE, LAST_MIDDLE_SLICE_EDGE_CUBIE, LAST_MOVE, LB, LBU, LD, LDB, LF, LFD, LI, LU, LUB, NO_QUARK, NOT_FLIPPED, NUMBER_OF_CLOCKWISE_QUARTER_TURN_MOVES, NUMBER_OF_CORNER_CUBIES, NUMBER_OF_EDGE_CUBIES, NUMBER_OF_MOVES, NUMBER_OF_TWISTS, QUARK, R, R2, RB, RBD, RD, RDF, RF, RFU, RI, RU, RUB, U, U2, UB, UBR, UF, UFL, UI, UL, ULB, UR, URF
 
Constructor Summary
KociembaCube()
           
 
Method Summary
 int getChoice()
          Four middle slice edge positions (12 choose 4 = 495).
 int getCornerPermutation()
          Permutation of the 8 corners (8! = 40320).
 int getFlip()
          Edge orientations (2^11 = 2048).
 int getMiddleSliceEdgePermutation()
          Permutation of the 4 middle slice edges (4! = 2.
 int getNonMiddleSliceEdgePermutation()
          Permutation of the 8 non-middle slice edges (8! = 40320).
 int getTwist()
          Corner orientations (3^7 = 2187).
 void setChoice(int choice)
           
 void setCornerPermutation(int ordinal)
           
 void setFlip(int flip)
           
 void setMiddleSliceEdgePermutation(int ordinal)
          Note: All of the middle slice edge cubies must be in the middle slice prior to calling prior to calling If that is not the case, then you must first call backToHome().
 void setNonMiddleSliceEdgePermutation(int ordinal)
          Note: None of the non middle slice edge cubies are allowed to be in the middle slice prior to calling this function.
 void setTwist(int twist)
           
 
Methods inherited from class ch.randelshofer.rubik.solver.Cube
applyMove, backToHome, clockwiseTwist, clone, counterClockwiseTwist, cycleFour, dump, equals, equals, flip, fourCycleCorner, fourCycleEdge, hashCode, inverseOfMove, moveB, moveB2, moveBI, moveD, moveD2, moveDI, moveF, moveF2, moveFI, moveL, moveL2, moveLI, moveNameToMove, moveR, moveR2, moveRI, moveU, moveU2, moveUI, nameOfMove, opposingFace, quarterTurnToHalfTurnMove, setState, symbolOfMove, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TWISTS

public static final int TWISTS
3^7 = 2187.

See Also:
Constant Field Values

FLIPS

public static final int FLIPS
2^11 = 2048.

See Also:
Constant Field Values

CHOICES

public static final int CHOICES
12 choose 4 = 495.

See Also:
Constant Field Values

CORNER_PERMUTATIONS

public static final int CORNER_PERMUTATIONS
8! = 40320.

See Also:
Constant Field Values

NON_MIDDLE_SLICE_EDGE_PERMUTATIONS

public static final int NON_MIDDLE_SLICE_EDGE_PERMUTATIONS
8! = 40320.

See Also:
Constant Field Values

MIDDLE_SLICE_EDGE_PERMUTATIONS

public static final int MIDDLE_SLICE_EDGE_PERMUTATIONS
4! = 24 .

See Also:
Constant Field Values
Constructor Detail

KociembaCube

public KociembaCube()
Method Detail

getTwist

public int getTwist()
Corner orientations (3^7 = 2187). Twist is represented as a trinary (base 3) number


setTwist

public void setTwist(int twist)

getFlip

public int getFlip()
Edge orientations (2^11 = 2048). Flip is represented as a binary number


setFlip

public void setFlip(int flip)

getChoice

public int getChoice()
Four middle slice edge positions (12 choose 4 = 495). Choice of the four middle slice edge positions Note that "choice" is for the permutation of those edge cubicles occupied by middle slice edge cubies, as opposed to a choice of all edge cubies within edge cubicles.


setChoice

public void setChoice(int choice)

getCornerPermutation

public int getCornerPermutation()
Permutation of the 8 corners (8! = 40320).


setCornerPermutation

public void setCornerPermutation(int ordinal)

getNonMiddleSliceEdgePermutation

public int getNonMiddleSliceEdgePermutation()
Permutation of the 8 non-middle slice edges (8! = 40320).


setNonMiddleSliceEdgePermutation

public void setNonMiddleSliceEdgePermutation(int ordinal)
Note: None of the non middle slice edge cubies are allowed to be in the middle slice prior to calling this function. If that is not the case, then you must first call backToHome().


getMiddleSliceEdgePermutation

public int getMiddleSliceEdgePermutation()
Permutation of the 4 middle slice edges (4! = 2.


setMiddleSliceEdgePermutation

public void setMiddleSliceEdgePermutation(int ordinal)
Note: All of the middle slice edge cubies must be in the middle slice prior to calling prior to calling If that is not the case, then you must first call backToHome().


(c) Werner Randelshofer.
All rights reserved.