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

Method cross

app/src/main/java/solver/Cross.java:280–306  ·  view source on GitHub ↗
(String scramble, int side, int face)

Source from the content-addressed store, hash-verified

278 }
279
280 private static String cross(String scramble, int side, int face) {
281 String[] s = scramble.split(" ");
282 int ep = 1656, eo = 1104;
283 for (int i = 0; i < s.length; i++)
284 if (s[i].length() != 0) {
285 int m = moveStr[side][face].indexOf(s[i].charAt(0));
286 eo = eom[eo][m]; ep = epm[ep][m];
287 if (s[i].length() > 1) {
288 eo = eom[eo][m];
289 ep = epm[ep][m];
290 if (s[i].charAt(1) == '\'') {
291 eo = eom[eo][m];
292 ep = epm[ep][m];
293 }
294 }
295 }
296 //sb = new StringBuilder();
297 for (int d = 0; d < 9; d++) {
298 if (idacross(ep, eo, d, -1)) {
299 StringBuilder sb = new StringBuilder(rotateStr[side][face]);
300 for (int i = d; i > 0; i--)
301 sb.append(' ').append(moveStr[0][side].charAt(seq[i] / 3)).append(suff[seq[i] % 3]);
302 return sb.toString();
303 }
304 }
305 return "error";
306 }
307
308 public static String solveCross(String scramble, int face) {
309 init();

Callers 1

solveCrossMethod · 0.95

Calls 4

idacrossMethod · 0.95
lengthMethod · 0.80
indexOfMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected