| 188 | } |
| 189 | |
| 190 | private static int getflpmv(int p, int m) { |
| 191 | //given orientation p<32 and move m<4, return new position number |
| 192 | //convert number into array; |
| 193 | int[] ps = new int[6]; |
| 194 | //edge orientation |
| 195 | Utils.idxToFlip(ps, p, 6, true); |
| 196 | //perform move on array |
| 197 | switch (m) { |
| 198 | case 0: //L |
| 199 | Utils.circle(ps, 1, 5, 2); |
| 200 | ps[2] ^= 1; ps[5] ^= 1; |
| 201 | break; |
| 202 | case 1: //R |
| 203 | Utils.circle(ps, 0, 2, 4); |
| 204 | ps[0] ^= 1; ps[2] ^= 1; |
| 205 | break; |
| 206 | case 2: //B |
| 207 | Utils.circle(ps, 3, 4, 5); |
| 208 | ps[3] ^= 1; ps[4] ^= 1; |
| 209 | break; |
| 210 | case 3: //U |
| 211 | Utils.circle(ps, 0, 3, 1); |
| 212 | ps[1] ^= 1; ps[3] ^= 1; |
| 213 | break; |
| 214 | } |
| 215 | return Utils.flipToIdx(ps, 6, true); |
| 216 | } |
| 217 | |
| 218 | private static int gettwsmv(int p, int m) { |
| 219 | //given orientation p<81 and move m<4, return new position number |