Exemplo n.º 1
0
        /// <summary>
        /// 盤面の情報を基にCPUの着手を取得します
        /// </summary>
        /// <returns></returns>
        public ulong GetCpuMove(ulong bk, ulong wh, CpuConfig cpuConfig)
        {
            ulong moveBit;

            moveBit = NativeMethods.KZ_GetCpuMove(bk, wh, cpuConfig);

            return moveBit;
        }
Exemplo n.º 2
0
 public CpuClass() 
 {
     cConfig = new CpuConfig();
 }
Exemplo n.º 3
0
        private CpuConfig SetCpuConfig(CpuClass cpuClass)
        {
            CpuConfig cpuConfig = new CpuConfig();

            cpuConfig.bookFlag = cpuClass.GetBookFlag();
            cpuConfig.bookVariability = cpuClass.GetBookVariability();
            cpuConfig.casheSize = cpuClass.GetCasheSize();
            cpuConfig.color = cpuClass.GetColor();
            cpuConfig.exactDepth = cpuClass.GetExactDepth();
            cpuConfig.mpcFlag = cpuClass.GetMpcFlag();
            cpuConfig.searchDepth = cpuClass.GetSearchDepth();
            cpuConfig.tableFlag = cpuClass.GetTableFlag();
            cpuConfig.winLossDepth = cpuClass.GetWinLossDepth();

            return cpuConfig;
        }
Exemplo n.º 4
0
        private int doSearch(ulong bk, ulong wh, CpuConfig cpuConfig, ulong moves, Form1 formobj, HintClass hintData)
        {
            int pos;
            int ret = 0;
            ulong move_bk, move_wh, rev;

            for (ulong m = moves; m != 0; m ^= 1UL << pos)
            {
                pos = cpw.CountBit((~m) & (m - 1));
                if (cpuConfig.color == BoardClass.WHITE)
                {
                    rev = cpw.GetBoardChangeInfo(bk, wh, pos);
                    move_bk = bk ^ ((1UL << pos) | rev);
                    move_wh = wh ^ rev;
                }
                else
                {
                    rev = cpw.GetBoardChangeInfo(wh, bk, pos);
                    move_wh = wh ^ ((1UL << pos) | rev);
                    move_bk = bk ^ rev;

                }
                cpw.GetCpuMove(move_bk, move_wh, cpuConfig);

                hintData.SetPos(pos);
                hintData.SetEval(-cpw.GetLastEvaluation());

                // UIに評価値を通知
                ((Form1)formobj).Invoke(((Form1)formobj).hintDelegate, new object[] { hintData });

                // 中断処理
                if (m_abort == true)
                {
                    m_abort = false;
                    ret = -1; 
                    break;
                }
            }

            return ret;
        }