| 274 | } |
| 275 | |
| 276 | static void initSym() { |
| 277 | Center1 c = new Center1(); |
| 278 | for (byte i=0; i<24; i++) { |
| 279 | c.ct[i] = i; |
| 280 | } |
| 281 | Center1 d = new Center1(c.ct); |
| 282 | Center1 e = new Center1(c.ct); |
| 283 | Center1 f = new Center1(c.ct); |
| 284 | |
| 285 | for (int i = 0; i < 48; i++) { |
| 286 | for (int j = 0; j < 48; j++) { |
| 287 | for (int k = 0; k < 48; k++) { |
| 288 | if (c.equals(d)) { |
| 289 | symmult[i][j] = k; |
| 290 | if (k==0) { |
| 291 | syminv[i] = j; |
| 292 | } |
| 293 | } |
| 294 | d.rot(0); |
| 295 | if ((k & 1) == 1) d.rot(1); |
| 296 | if ((k & 7) == 7) d.rot(2); |
| 297 | if ((k & 15) == 15) d.rot(3); |
| 298 | } |
| 299 | c.rot(0); |
| 300 | if ((j & 1) == 1) c.rot(1); |
| 301 | if ((j & 7) == 7) c.rot(2); |
| 302 | if ((j & 15) == 15) c.rot(3); |
| 303 | } |
| 304 | c.rot(0); |
| 305 | if ((i & 1) == 1) c.rot(1); |
| 306 | if ((i & 7) == 7) c.rot(2); |
| 307 | if ((i & 15) == 15) c.rot(3); |
| 308 | } |
| 309 | |
| 310 | for (int i = 0; i < 48; i++) { |
| 311 | c.set(e); |
| 312 | c.rotate(syminv[i]); |
| 313 | for (int j = 0; j < 36; j++) { |
| 314 | d.set(c); |
| 315 | d.move(j); |
| 316 | d.rotate(i); |
| 317 | for (int k = 0; k < 36; k++) { |
| 318 | f.set(e); |
| 319 | f.move(k); |
| 320 | if (f.equals(d)) { |
| 321 | symmove[i][j] = k; |
| 322 | break; |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | c.set(0); |
| 329 | for (int i = 0; i < 48; i++) { |
| 330 | finish[syminv[i]] = c.get(); |
| 331 | c.rot(0); |
| 332 | if ((i & 1) == 1) c.rot(1); |
| 333 | if ((i & 7) == 7) c.rot(2); |