class CubieCube extends Object
Modifier and Type | Field and Description |
---|---|
(package private) byte[] |
co
Corner orientation.
|
private static byte[] |
coB |
private static byte[] |
coD |
private static byte[] |
coF |
private static byte[] |
coL |
private static byte[] |
coR |
private static byte[] |
coU |
(package private) Corner[] |
cp
Corner permutation, represented in the "is replaced by" representation
|
private static Corner[] |
cpB |
private static Corner[] |
cpD |
private static Corner[] |
cpF |
private static Corner[] |
cpL |
private static Corner[] |
cpR |
private static Corner[] |
cpU |
(package private) byte[] |
eo
Edge orientation
The i-th orientation is the orientation of the edge that is currently at index i in ep |
private static byte[] |
eoB |
private static byte[] |
eoD |
private static byte[] |
eoF |
private static byte[] |
eoL |
private static byte[] |
eoR |
private static byte[] |
eoU |
(package private) Edge[] |
ep
Edge permutation, represented in the "is replaced by" representation
|
private static Edge[] |
epB |
private static Edge[] |
epD |
private static Edge[] |
epF |
private static Edge[] |
epL |
private static Edge[] |
epR |
private static Edge[] |
epU |
(package private) static CubieCube[] |
moveCube
CubieCube array representing the 6 basic cube moves
|
Constructor and Description |
---|
CubieCube() |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
Cnk(int n,
int k)
n choose k
|
(package private) void |
cornerMultiply(CubieCube b)
Multiply this CubieCube with another CubieCube b, restricted to the corners.
|
(package private) short |
cornerParity() |
(package private) void |
edgeMultiply(CubieCube b)
Multiply this CubieCube with another CubieCube b, restricted to the edges.
|
(package private) short |
edgeParity() |
(package private) short |
getFlip() |
(package private) short |
getFRtoBR() |
(package private) CubieCube |
getInvCubieCube()
Computes the "inverse cube" of current cube.
|
(package private) short |
getTwist() |
(package private) short |
getUBtoDF()
Permutation of the three edges UB,DR,DF
|
(package private) short |
getURFtoDLF() |
(package private) int |
getURtoDF()
Permutation of the six edges UR,UF,UL,UB,DR,DF.
|
static int |
getURtoDF(short idx1,
short idx2)
Permutation of the six edges UR,UF,UL,UB,DR,DF
|
(package private) short |
getURtoUL()
Permutation of the three edges UR,UF,UL
|
(package private) void |
multiply(CubieCube b)
Multiply this CubieCube with another CubieCube b
|
(package private) static void |
rotateLeft(Corner[] arr,
int l,
int r)
Left rotation of all array elements between l and r
|
(package private) static void |
rotateLeft(Edge[] arr,
int l,
int r)
Left rotation of all array elements between l and r
|
(package private) static void |
rotateRight(Corner[] arr,
int l,
int r)
Right rotation of all array elements between l and r
|
(package private) static void |
rotateRight(Edge[] arr,
int l,
int r)
Right rotation of all array elements between l and r
|
(package private) void |
setFlip(short flip)
Sets edges orientation according to coordinate value
|
(package private) void |
setFRtoBR(short idx)
Sets permutation of the UD-slice edges FR,FL,BL and BR
|
(package private) void |
setTwist(short twist)
Sets corners orientation according to coordinate value
|
(package private) void |
setUBtoDF(short idx)
Sets the permutation of the three edges UB,DR,DF
|
(package private) void |
setURFtoDLF(short idx)
Sets permutation of all corners except DBL and DRB
|
(package private) void |
setURtoDF(int idx)
Permutation of the six edges UR,UF,UL,UB,DR,DF.
|
(package private) void |
setURtoUL(short idx)
Sets the permutation of the three edges UR,UF,UL
|
(package private) FaceCube |
toFaceCube()
return cube in facelet representation
|
(package private) int |
verify()
Validate received cube (check that it is a valid one)
|
Corner[] cp
byte[] co
Edge[] ep
byte[] eo
private static Corner[] cpU
private static byte[] coU
private static Edge[] epU
private static byte[] eoU
private static Corner[] cpR
private static byte[] coR
private static Edge[] epR
private static byte[] eoR
private static Corner[] cpF
private static byte[] coF
private static Edge[] epF
private static byte[] eoF
private static Corner[] cpD
private static byte[] coD
private static Edge[] epD
private static byte[] eoD
private static Corner[] cpL
private static byte[] coL
private static Edge[] epL
private static byte[] eoL
private static Corner[] cpB
private static byte[] coB
private static Edge[] epB
private static byte[] eoB
static CubieCube[] moveCube
static int Cnk(int n, int k)
static void rotateLeft(Corner[] arr, int l, int r)
static void rotateRight(Corner[] arr, int l, int r)
static void rotateLeft(Edge[] arr, int l, int r)
static void rotateRight(Edge[] arr, int l, int r)
FaceCube toFaceCube()
void cornerMultiply(CubieCube b)
b
- - the cube to multiply byvoid edgeMultiply(CubieCube b)
b
- - the cube to multiply byvoid multiply(CubieCube b)
b
- - the cube to multiply byCubieCube getInvCubieCube()
short getTwist()
void setTwist(short twist)
twist
- - corners orientation coordinate. 0 <= twist < 3^7short getFlip()
void setFlip(short flip)
flip
- - edges orientation coordinate. 0 <= flip < 2^11short cornerParity()
short edgeParity()
short getFRtoBR()
void setFRtoBR(short idx)
idx
- - permutation coordinate valueshort getURFtoDLF()
void setURFtoDLF(short idx)
idx
- - permutation coordinate valueint getURtoDF()
void setURtoDF(int idx)
idx
- - permutation coordinate valuepublic static int getURtoDF(short idx1, short idx2)
idx1
- - UR, UF and UL permutation coordinate valueidx2
- - UB, DR and DF permutation coordinate valueshort getURtoUL()
void setURtoUL(short idx)
idx
- - permutation coordinate valueshort getUBtoDF()
void setUBtoDF(short idx)
idx
- - permutation coordinate valueint verify()