?? aspirationsearch.cpp
字號:
// AspirationSearch.cpp: implementation of the CAspirationSearch class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "AspirationSearch.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CAspirationSearch::CAspirationSearch()
{
}
CAspirationSearch::~CAspirationSearch()
{
}
CAspirationSearch::SearchAGoodMove(BYTE position[][9])
{
int x,y;
memcpy(CurPosition,position,90);
//先進(jìn)行淺層搜索,猜測目標(biāo)值范圍
m_nMaxDepth=m_nSearchDepth-1;
x=FAlphaBeta(m_nMaxDepth,-20000,20000);
m_pThinkProgress->SetPos(0);
//對目標(biāo)值附近的小窗口進(jìn)行搜索
m_nMaxDepth=m_nSearchDepth;
y=FAlphaBeta(m_nMaxDepth,x-50,x+50);
if(y<x-50)//fail-low research
{
m_pThinkProgress->SetPos(0);
FAlphaBeta(m_nMaxDepth,-20000,y);
}
if(y>x+50)//fail-high research
{
m_pThinkProgress->SetPos(0);
FAlphaBeta(m_nMaxDepth,y,20000);
}
m_umUndoMove.cmChessMove=m_cmBestMove;
m_umUndoMove.nChessID=MakeMove(&m_cmBestMove);
memcpy(position,CurPosition,90);//將走過的棋盤傳出
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -