# 1.概率分析

• GetEatPercent
• GetBombPercent
• GetKilledPercent

• aLiveTypeSum [14]
表示大于某个级别的并且还活着的明棋的总数，即敌方吃过子的棋
• aLiveTypeAll[14]
表示大于某个级别的并且还活着的明棋总数再加上所有大于该级别的暗棋包括被暗吃的

num = (aLiveTypeAll[GONGB]-aLiveTypeSum[GONGB])+nBomb+nLand;


	mxNum = (aLiveTypeAll[mxDstType-1]-aLiveTypeSum[mxDstType-1]);


nSrc = aLiveTypeAll[src]-aLiveTypeSum[src]+nBomb+nLand;


nSrc = (nSrc>mxNum)?nSrc:mxNum;


percent = ((num-nSrc)<<8)/(num-mxNum);


# 2.搜索优化

    u8 val[4];
val[0] = pSrc->iDir;
val[1] = pSrc->pLineup->index;
val[2] = pDst->iDir;
val[3] = pDst->pLineup->index;
pJunqi->iKey ^= *((int*)val);


    val[0] = pSrc->pLineup->index<<pSrc->iDir;
val[1] = pSrc->pLineup->index;
val[2] = pDst->pLineup->index<<pDst->iDir;
val[3] = pDst->pLineup->index;
pJunqi->iKey ^= *((int*)val);


    	MakeNextMove(pJunqi,&p->move);
iKey = GetHashKey(pJunqi);
if( CheckMoveHash(&paHash,iKey) &&
IsNotSameMove(p) )
{
if( p->move.result>MOVE )
{
while( !memcmp( &p->move, &p->pNext->move, 4) )
{
p = p->pNext;
}
}
//把局面撤回到上一步
UnMakeMove(pJunqi,&p->move);
goto continue_search;
}
else
{
val = CallAlphaBeta(pJunqi,depth-1,alpha,beta,iDir);

//把局面撤回到上一步
UnMakeMove(pJunqi,&p->move);
}


# 3.源代码

https://github.com/pfysw/JunQi

10-29

07-16
10-29 276
09-24 612
08-21 1017
09-16 522
07-30 2175
03-18
05-02
11-11
09-14
01-05 229
03-17 326
11-25 555
12-14 286
08-17 316
08-07 1472