Beispiel #1
0
        public static int GetSolvedSym(CenterCube cube)
        {
            Center1 c = new Center1(cube.Ct);

            for (int j = 0; j < 48; j++)
            {
                bool check = true;
                for (int i = 0; i < 24; i++)
                {
                    if (c.Ct[i] != i / 4)
                    {
                        check = false;
                        break;
                    }
                }
                if (check)
                {
                    return(j);
                }
                c.Rot(0);
                if (j % 2 == 1)
                {
                    c.Rot(1);
                }
                if (j % 8 == 7)
                {
                    c.Rot(2);
                }
                if (j % 16 == 15)
                {
                    c.Rot(3);
                }
            }
            return(-1);
        }
Beispiel #2
0
 public Center1(CenterCube c, int urf)
 {
     for (int i = 0; i < 24; i++)
     {
         Ct[i] = (sbyte)((c.Ct[i] / 2 == urf) ? 1 : 0);
     }
 }
Beispiel #3
0
 public void Copy(CenterCube c)
 {
     for (int i = 0; i < 24; i++)
     {
         Ct[i] = c.Ct[i];
     }
 }
Beispiel #4
0
 public Center2(CenterCube c) : this()
 {
     for (int i = 0; i < 16; i++)
     {
         ct[i] = c.Ct[i] / 2;
     }
     for (int i = 0; i < 8; i++)
     {
         rl[i] = c.Ct[i + 16];
     }
 }
Beispiel #5
0
 public void Set(CenterCube c, int edgeParity)
 {
     for (int i = 0; i < 16; i++)
     {
         ct[i] = c.Ct[i] / 2;
     }
     for (int i = 0; i < 8; i++)
     {
         rl[i] = c.Ct[i + 16];
     }
     parity = edgeParity;
 }
Beispiel #6
0
        public void Set(CenterCube c, int eXc_parity)
        {
            int parity = (c.Ct[0] > c.Ct[8] ^ c.Ct[8] > c.Ct[16] ^ c.Ct[0] > c.Ct[16]) ? 1 : 0;

            for (int i = 0; i < 8; i++)
            {
                ud[i] = (c.Ct[i] & 1) ^ 1;
                fb[i] = (c.Ct[i + 8] & 1) ^ 1;
                rl[i] = (c.Ct[i + 16] & 1) ^ 1 ^ parity;
            }
            this.parity = parity ^ eXc_parity;
        }
Beispiel #7
0
 public FullCube()
 {
     edge   = new EdgeCube();
     center = new CenterCube();
     corner = new CornerCube();
 }
Beispiel #8
0
 public FullCube(Random r)
 {
     edge   = new EdgeCube(r);
     center = new CenterCube(r);
     corner = new CornerCube(r);
 }
Beispiel #9
0
 public CenterCube(CenterCube c)
 {
     Copy(c);
 }