|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.rubik.RubiksStickerCube
public class RubiksStickerCube
The RubiksStickerCube represents a Rubik's Cube by the markings of its 54 individual stickers. The RubiksStickerCube can then be asked to validate the cube to determine if it is in a legal, and thus solvable, configuration.
The stickers are expressed by the values 0 through 6 representing the six faces of the cube: front, right, down, back, left, up. The value -1 is used to express an unknown sticker value. The RubiksStickerCube can fill in values for unknown stickers.
This class has been derived from facecube.cpp and facecube.h from the 'Kociemba Cube Solver 1.0' (KCube) (c) Greg Schmidt.
| Field Summary | |
|---|---|
static int |
B
|
static int |
D
|
static int |
DUPLICATE_CENTER_MARKING
|
static int |
F
|
static int |
INVALID_CORNER_MARKINGS
|
static int |
INVALID_CORNER_PARITY
|
static int |
INVALID_EDGE_MARKINGS
|
static int |
INVALID_EDGE_PARITY
|
static int |
INVALID_FACELETCOUNT
|
static int |
INVALID_MARKER
|
static int |
INVALID_TOTAL_PARITY
|
static int |
L
|
static int |
NUMBER_OF_ERRORS
|
static int |
R
|
static int |
U
|
static int |
VALID
|
| Constructor Summary | |
|---|---|
RubiksStickerCube()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
dump()
Dump cube state. |
java.lang.String |
getErrorText(int error)
Return the text associated with an error return code. |
void |
setStickers(int[] stickers)
|
java.lang.String |
toString()
|
int |
validate(Cube cube)
Validate markings, permutation, and parity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int F
public static final int R
public static final int D
public static final int B
public static final int L
public static final int U
public static final int VALID
public static final int INVALID_MARKER
public static final int INVALID_FACELETCOUNT
public static final int DUPLICATE_CENTER_MARKING
public static final int INVALID_CORNER_MARKINGS
public static final int INVALID_CORNER_PARITY
public static final int INVALID_EDGE_MARKINGS
public static final int INVALID_EDGE_PARITY
public static final int INVALID_TOTAL_PARITY
public static final int NUMBER_OF_ERRORS
| Constructor Detail |
|---|
public RubiksStickerCube()
| Method Detail |
|---|
public void setStickers(int[] stickers)
public int validate(Cube cube)
public java.lang.String getErrorText(int error)
public void dump()
public java.lang.String toString()
toString in class java.lang.Object
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||