예제 #1
0
 void rot(int r) {
   switch (r) {
     case 0:
       move(ux2);
       move(dx2);
       break;
     case 1:
       move(rx1);
       move(lx3);
       break;
     case 2:
       swap(ct, 0, 3, 1, 2, 1);
       swap(ct, 8, 11, 9, 10, 1);
       swap(ct, 4, 7, 5, 6, 1);
       swap(ct, 12, 15, 13, 14, 1);
       swap(ct, 16, 19, 21, 22, 1);
       swap(ct, 17, 18, 20, 23, 1);
       break;
     case 3:
       move(ux1);
       move(dx3);
       move(fx1);
       move(bx3);
       break;
   }
 }
예제 #2
0
 static void createMoveTable() {
   System.out.println("Create Phase1 Center Move Table...");
   Center1 c = new Center1();
   Center1 d = new Center1();
   for (int i = 0; i < 15582; i++) {
     d.set(sym2raw[i]);
     for (int m = 0; m < 36; m++) {
       c.set(d);
       c.move(m);
       ctsmv[i][m] = c.getsym();
     }
   }
 }
예제 #3
0
  static void initSym() {
    Center1 c = new Center1();
    for (byte i = 0; i < 24; i++) {
      c.ct[i] = i;
    }
    Center1 d = new Center1(c.ct);
    Center1 e = new Center1(c.ct);
    Center1 f = new Center1(c.ct);

    for (int i = 0; i < 48; i++) {
      for (int j = 0; j < 48; j++) {
        for (int k = 0; k < 48; k++) {
          if (c.equals(d)) {
            symmult[i][j] = k;
            if (k == 0) {
              syminv[i] = j;
            }
          }
          d.rot(0);
          if (k % 2 == 1) d.rot(1);
          if (k % 8 == 7) d.rot(2);
          if (k % 16 == 15) d.rot(3);
        }
        c.rot(0);
        if (j % 2 == 1) c.rot(1);
        if (j % 8 == 7) c.rot(2);
        if (j % 16 == 15) c.rot(3);
      }
      c.rot(0);
      if (i % 2 == 1) c.rot(1);
      if (i % 8 == 7) c.rot(2);
      if (i % 16 == 15) c.rot(3);
    }

    for (int i = 0; i < 48; i++) {
      c.set(e);
      c.rotate(syminv[i]);
      for (int j = 0; j < 36; j++) {
        d.set(c);
        d.move(j);
        d.rotate(i);
        for (int k = 0; k < 36; k++) {
          f.set(e);
          f.move(k);
          if (f.equals(d)) {
            symmove[i][j] = k;
            break;
          }
        }
      }
    }

    c.set(0);
    for (int i = 0; i < 48; i++) {
      finish[syminv[i]] = c.get();
      c.rot(0);
      if (i % 2 == 1) c.rot(1);
      if (i % 8 == 7) c.rot(2);
      if (i % 16 == 15) c.rot(3);
    }
  }