コード例 #1
0
ファイル: CoordCubeHuge.cs プロジェクト: theosZA/CubeCam
        static void initTwistMoveConj()
        {
            CubieCube c = new CubieCube();
            CubieCube d = new CubieCube();

            for (int i = 0; i < N_TWIST; i++)
            {
                c.setTwist(i);
                for (int j = 0; j < N_MOVES; j += 3)
                {
                    CubieCube.CornMult(c, CubieCube.moveCube[j], d);
                    TwistMoveF[i, j] = (char)d.getTwist();
                }
                for (int j = 0; j < 16; j++)
                {
                    CubieCube.CornConjugate(c, CubieCube.SymInv[j], d);
                    TwistConj[i, j] = (char)d.getTwist();
                }
            }
            for (int i = 0; i < N_TWIST; i++)
            {
                for (int j = 0; j < N_MOVES; j += 3)
                {
                    int twist = TwistMoveF[i, j];
                    for (int k = 1; k < 3; k++)
                    {
                        twist = TwistMoveF[twist, j];
                        TwistMoveF[i, j + k] = (char)twist;
                    }
                }
            }
        }
コード例 #2
0
        internal static void initTwistSym2Raw()
        {
            CubieCube c     = new CubieCube();
            CubieCube d     = new CubieCube();
            int       count = 0;

            TwistR2S = new char[2187];
            for (int i = 0; i < 2187; i++)
            {
                if (TwistR2S[i] != 0)
                {
                    continue;
                }
                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));
                    }
                    TwistR2S[idx] = (char)(count << 3 | s >> 1);
                    if (Search.EXTRA_PRUN_LEVEL > 0)
                    {
                        TwistS2RF[count << 3 | s >> 1] = (char)idx;
                    }
                }
                TwistS2R[count++] = (char)i;
            }
            if (count != 324)
            {
                throw new Exception("Unexpected count value");
            }
        }
コード例 #3
0
ファイル: CoordCube.cs プロジェクト: theosZA/CubeCam
        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();
                }
            }
        }