예제 #1
0
        //[MethodImpl(MethodImplOptions.Synchronized)]
        static Search()
        {
            ////System.out.println("Initialize Center1 Solver...");

            InitSym();
            raw2sym = new int[735471];
            InitSym2Raw();
            CreateMoveTable();
            raw2sym = null;
            CreatePrun();

            ////System.out.println("Initialize Center2 Solver...");

            Init();

            ////System.out.println("Initialize Center3 Solver...");

            Center3.Init();

            ////System.out.println("Initialize Edge3 Solver...");

            Edge3.InitMvrot();
            Edge3.InitRaw2Sym();
            Edge3.CreatePrun();

            ////System.out.println("OK");
        }
예제 #2
0
        public static void Init()
        {
            for (int i = 0; i < 12; i++)
            {
                std2rl[rl2std[i]] = i;
            }

            Center3 c = new Center3();

            for (int i = 0; i < 35 * 35 * 12 * 2; i++)
            {
                for (int m = 0; m < 20; m++)
                {
                    c.Setct(i);
                    c.Move(m);
                    ctmove[i, m] = (char)c.Getct();
                }
            }

            for (int i = 0; i < prun.Length; i++)
            {
                prun[i] = -1;
            }
            prun[0] = 0;
            int depth = 0;
            int done  = 1;

            while (done != 29400)
            {
                for (int i = 0; i < 29400; i++)
                {
                    if (prun[i] != depth)
                    {
                        continue;
                    }
                    for (int m = 0; m < 17; m++)
                    {
                        if (prun[ctmove[i, m]] == -1)
                        {
                            prun[ctmove[i, m]] = (sbyte)(depth + 1);
                            done++;
                        }
                    }
                }
                depth++;
                // //System.out.println(string.format("%2d%10d", depth, done));
            }
        }