資源簡介
用c語言寫的中國象棋源代碼。南航的一個學生編寫。可以記錄走法。
代碼片段和文件信息
//?AlphaBetaEngine.cpp:?implementation?of?the?CAlphaBetaEngine?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“AlphaBetaEngine.h“
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CAlphaBetaEngine::CAlphaBetaEngine()
{
}
CAlphaBetaEngine::~CAlphaBetaEngine()
{
}
CAlphaBetaEngine::SearchAGoodMove(BYTE?position[][9])
{
memcpy(CurPositionposition90);????//將當前局面復制到CurPosition
m_nMaxDepth=m_nSearchDepth; //設定搜索深度
AlphaBeta(m_nMaxDepth-2000020000);//進行alphabeta搜索
m_umUndoMove.cmChessMove=m_cmBestMove;
m_umUndoMove.nChessID=MakeMove(&m_cmBestMove);
memcpy(positionCurPosition90); //將走過的棋盤傳出
}
int?CAlphaBetaEngine::AlphaBeta(int?nDepthint?alphaint?beta)
{
int?score;
int?Counti;
BYTE?type;
i=IsGameOver(CurPositionnDepth);//檢查是否游戲結束
if(i!=0)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.CA....??????2109??2002-07-27?16:17??中國象棋\SourceCode\AlphaBetaEngine.cpp
????.CA....???????819??2000-07-18?13:03??中國象棋\SourceCode\AlphaBetaEngine.h
????.CA....??????2198??2004-08-23?20:09??中國象棋\SourceCode\Alphabeta_HH.cpp
????.CA....???????826??2004-08-23?20:09??中國象棋\SourceCode\Alphabeta_HH.h
????.CA....??????2746??2004-08-23?20:20??中國象棋\SourceCode\AlphaBeta_TTEngine.cpp
????.CA....???????840??2004-08-23?20:10??中國象棋\SourceCode\AlphaBeta_TTEngine.h
????.CA....??????1209??2002-07-27?16:17??中國象棋\SourceCode\AspirationSearch.cpp
????.CA....???????704??2004-08-23?20:11??中國象棋\SourceCode\AspirationSearch.h
????.CA....??????2049??2004-07-05?11:48??中國象棋\SourceCode\Chess.cpp
????.CA....??????7834??2004-08-23?20:41??中國象棋\SourceCode\Chess.dsp
????.CA....???????535??2004-08-19?09:26??中國象棋\SourceCode\Chess.dsw
????.CA....????208896??2004-08-23?20:44??中國象棋\SourceCode\Chess.exe
????.CA..H.??????8628??2004-08-19?09:07??中國象棋\SourceCode\Chess.GID
????.CA....??????1334??2004-08-23?20:19??中國象棋\SourceCode\Chess.h
????.CA....?????60928??2004-08-23?20:45??中國象棋\SourceCode\Chess.opt
????.CA....?????11913??2004-08-23?20:44??中國象棋\SourceCode\Chess.rc
????.CA....?????49164??2004-08-23?20:13??中國象棋\SourceCode\ChessDlg.cpp
????.CA....??????5458??2004-08-23?20:20??中國象棋\SourceCode\ChessDlg.h
????.CA...R??????6149??2003-04-24?16:41??中國象棋\SourceCode\CoolButton.cpp
????.CA...R??????1527??2003-04-24?16:41??中國象棋\SourceCode\CoolButton.h
????.CA....??????1534??2004-08-18?18:17??中國象棋\SourceCode\Define.h
????.CA....?????20076??2004-08-19?14:50??中國象棋\SourceCode\Eveluation.cpp
????.CA....??????2554??2004-08-19?14:37??中國象棋\SourceCode\Eveluation.h
????.CA....??????2181??2002-07-27?16:17??中國象棋\SourceCode\FAlphaBetaEngine.cpp
????.CA....???????818??2000-07-21?21:45??中國象棋\SourceCode\FAlphaBetaEngine.h
????.CA....??????4539??2004-08-17?14:32??中國象棋\SourceCode\GradientProgressCtrl.cpp
????.CA....??????2221??2004-08-17?14:29??中國象棋\SourceCode\GradientProgressCtrl.h
????.CA....??????1674??2004-08-16?13:17??中國象棋\SourceCode\HelpDlg.cpp
????.CA....??????1243??2004-08-20?10:24??中國象棋\SourceCode\HelpDlg.h
????.CA....??????2643??2004-08-17?15:56??中國象棋\SourceCode\HistoryHeuristic.cpp
............此處省略58個文件信息
評論
共有 條評論