Exemple #1
0
        public bool SetWithPrun(CubieCube cc, int depth)
        {
            twist = cc.GetTwistSym();
            flip  = cc.GetFlipSym();
            tsym  = twist & 7;
            twist = twist >> 3;

            prun = Search.USE_TWIST_FLIP_PRUN ? GetPruning(TwistFlipPrun,
                                                           twist << 11 | CubieCube.FlipS2RF[flip ^ tsym]) : 0;
            if (prun > depth)
            {
                return(false);
            }

            fsym = flip & 7;
            flip = flip >> 3;

            slice = cc.GetUDSlice();
            prun  = Math.Max(prun, Math.Max(
                                 GetPruning(UDSliceTwistPrun,
                                            twist * N_SLICE + UDSliceConj[slice, tsym]),
                                 GetPruning(UDSliceFlipPrun,
                                            flip * N_SLICE + UDSliceConj[slice, fsym])));
            if (prun > depth)
            {
                return(false);
            }

            if (Search.USE_CONJ_PRUN)
            {
                CubieCube pc = new CubieCube();
                CubieCube.CornConjugate(cc, 1, pc);
                CubieCube.EdgeConjugate(cc, 1, pc);
                twistc = pc.GetTwistSym();
                flipc  = pc.GetFlipSym();
                prun   = Math.Max(prun,
                                  GetPruning(TwistFlipPrun,
                                             (twistc >> 3) << 11 | CubieCube.FlipS2RF[flipc ^ (twistc & 7)]));
            }

            return(prun <= depth);
        }
Exemple #2
0
        public static void InitCombPMoveConj()
        {
            CubieCube c = new CubieCube();
            CubieCube d = new CubieCube();

            CCombPMove = new char[N_COMB, N_MOVES2];
            for (int i = 0; i < N_COMB; i++)
            {
                c.SetCComb(i % 70);
                for (int j = 0; j < N_MOVES2; j++)
                {
                    CubieCube.CornMult(c, CubieCube.moveCube[Util.ud2std[j]], d);
                    CCombPMove[i, j] = (char)(d.GetCComb() + 70 * ((P2_PARITY_MOVE >> j & 1) ^ (i / 70)));
                }
                for (int j = 0; j < 16; j++)
                {
                    CubieCube.CornConjugate(c, CubieCube.SymMultInv[0, j], d);
                    CCombPConj[i, j] = (char)(d.GetCComb() + 70 * (i / 70));
                }
            }
        }