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

Method getprmmv

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

Source from the content-addressed store, hash-verified

168 }
169
170 private static int getprmmv(int p, int m) {
171 //given position p<360 and move m<4, return new position number
172 //convert number into array
173 int[] ps = new int[6];
174 //edge permutation
175 Utils.idxToPerm(ps, p, 6, true);
176 //perform move on array
177 if (m == 0) {
178 Utils.circle(ps, 1, 5, 2); //L
179 } else if (m == 1) {
180 Utils.circle(ps, 0, 2, 4); //R
181 } else if (m == 2) {
182 Utils.circle(ps, 3, 4, 5); //B
183 } else if (m == 3) {
184 Utils.circle(ps, 0, 3, 1); //U
185 }
186 //convert array back to number
187 return(Utils.permToIdx(ps, 6, true));
188 }
189
190 private static int getflpmv(int p, int m) {
191 //given orientation p<32 and move m<4, return new position number

Callers 1

calcpermMethod · 0.95

Calls 3

idxToPermMethod · 0.95
circleMethod · 0.95
permToIdxMethod · 0.95

Tested by

no test coverage detected