MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / toCubieCube

Method toCubieCube

app/src/main/java/cs/min2phase/Util.java:135–164  ·  view source on GitHub ↗
(String facelets, CubieCube ccRet)

Source from the content-addressed store, hash-verified

133 static boolean[][] ckmv2 = new boolean[11][10];
134
135 public static int toCubieCube(String facelets, CubieCube ccRet) {
136 int count = 0x000000;
137 byte[] f = new byte[54];
138 try {
139 String center = new String(
140 new char[] {
141 facelets.charAt(4),
142 facelets.charAt(13),
143 facelets.charAt(22),
144 facelets.charAt(31),
145 facelets.charAt(40),
146 facelets.charAt(49)
147 }
148 );
149 for (int i = 0; i < 54; i++) {
150 f[i] = (byte) center.indexOf(facelets.charAt(i));
151 if (f[i] == -1) {
152 return -1;
153 }
154 count += 1 << (f[i] << 2);
155 }
156 } catch (Exception e) {
157 return -1;
158 }
159 if (count != 0x999999) {
160 return -1;
161 }
162 toCubieCube(f, ccRet);
163 return ccRet.verify();
164 }
165
166 private static void toCubieCube(byte[] f, CubieCube ccRet) {
167 byte ori;

Callers 3

setCubeStateMethod · 0.95
verifyMethod · 0.95
solutionMethod · 0.95

Calls 2

indexOfMethod · 0.80
verifyMethod · 0.45

Tested by

no test coverage detected