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

Method gettwsmv

app/src/main/java/solver/Pyraminx.java:218–242  ·  view source on GitHub ↗
(int p, int m)

Source from the content-addressed store, hash-verified

216 }
217
218 private static int gettwsmv(int p, int m) {
219 //given orientation p<81 and move m<4, return new position number
220 //convert number into array;
221 int[] ps = new int[4];
222 //corner orientation
223 Utils.idxToOri(ps, p, 4, false);
224 //perform move on array
225 switch (m) {
226 case 0: //L
227 ps[1]++; if (ps[1] == 3) ps[1] = 0;
228 break;
229 case 1: //R
230 ps[2]++; if (ps[2] == 3) ps[2] = 0;
231 break;
232 case 2: //B
233 ps[3]++; if (ps[3] == 3) ps[3] = 0;
234 break;
235 case 3: //U
236 ps[0]++; if (ps[0] == 3) ps[0] = 0;
237 break;
238 }
239 //convert array back to number
240 //corner orientation
241 return(Utils.oriToIdx(ps, 4, false));
242 }
243
244 private static void picmove(int type, int direction) {
245 switch (type) {

Callers 1

calcpermMethod · 0.95

Calls 2

idxToOriMethod · 0.95
oriToIdxMethod · 0.95

Tested by

no test coverage detected