Beispiel #1
0
        internal static void InitTwistSym2Raw()
        {
            CubieCube c = new CubieCube();
            CubieCube d = new CubieCube();

            int[] occ   = new int[2187 / 32 + 1];
            int   count = 0;

            for (int i = 0; i < 2187 / 32 + 1; occ[i++] = 0)
            {
                ;
            }
            TwistR2S = new char[2187];
            for (int i = 0; i < 2187; i++)
            {
                if ((occ[i >> 5] & (1 << (i & 0x1f))) == 0)
                {
                    c.SetTwist(i);
                    for (int s = 0; s < 16; s += 2)
                    {
                        CornConjugate(c, s, d);
                        int idx = d.GetTwist();
                        if (idx == i)
                        {
                            SymStateTwist[count] |= (char)(1 << (s >> 1));
                        }
                        occ[idx >> 5] |= 1 << (idx & 0x1f);
                        TwistR2S[idx]  = (char)((count << 3) | (s >> 1));
                    }
                    TwistS2R[count++] = (char)i;
                }
            }
        }
Beispiel #2
0
        internal static void InitTwistMove()
        {
            CubieCube c = new CubieCube();
            CubieCube d = new CubieCube();

            for (int i = 0; i < N_TWIST_SYM; i++)
            {
                c.SetTwist(CubieCube.TwistS2R[i]);
                for (int j = 0; j < N_MOVES; j++)
                {
                    CubieCube.CornMult(c, CubieCube.MoveCube[j], d);
                    TwistMove[i][j] = (char)d.GetTwistSym();
                }
            }
        }