-
大小: 167KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-09
- 語言: C/C++
- 標簽:
資源簡介
C++象棋游戲C++象棋游戲C++象棋游戲C++象棋游戲C++象棋游戲C++象棋游戲C++象棋游戲C++象棋游戲C++象棋游戲

代碼片段和文件信息
#include?“StdAfx.h“
#include?“Calculate.h“
#include?“MantisChessThink.h“
#include?“string.h“
#include?“stdio.h“
/*************************************************************************
把Think重新包裝一下進行坐標變換希望以后其他人的算法的接口都采用這個函數(shù)
這樣的編譯出來的DLL可以直接替換原來的CChessThinker.dll
timespan是思考的限定時間,以毫秒為單位,時間不同可能導(dǎo)致不同的思考策略。
本程序中的算法沒有使用這一變量。
**************************************************************************/
BOOL?Calculate(char*?mapint?timespanint&?x1int&?y1int&?x2int&?y2)
{
//BOOL?Thinking(int?tmap[11][12]POINT?tmanposition[32]int?&tsideint?&resultman?POINT?&resultpoint);
int?tmap[11][12];
POINT?manpoint[32];
int?side=(int)map[0]-48;
int?resultman=32;
POINT?resultpoint={00};
for?(int?i?=?0;?i?11;?i++)
{
for?(int?j?=?0;?j?12;?j++)
{
tmap[i][j]?=?32;
}
}
for?(int?i?=?0;?i?32;?i++)
{
manpoint[i].x=0;
manpoint[i].y=0;
}
int?length=(int)strlen(map);
int?index?=?1;
while?(index? {
int?x?=1?+?((int)map[index?+?0]-48);//thinking的x從1到9
int?y?=?10?-?((int)map[index?+?1]-48);//thinking的y從10到1
int?color?=?(int)map[index?+?2]-48;//0-RED1-BLAVK
int?type?=?(int)map[index?+?3]-48;//0-6
int?manIndex=0;
if?(color==0)
{
switch?(type)
{
case?0:
manIndex=0;
break;
case?1:
if?(manpoint[1].x==0)?manIndex=1;
else?manIndex=2;
break;
case?2:
if?(manpoint[3].x==0)?manIndex=3;
else?manIndex=4;
break;
case?3:
if?(manpoint[5].x==0)?manIndex=5;
else?manIndex=6;
break;
case?4:
if?(manpoint[7].x==0)?manIndex=7;
else?manIndex=8;
break;
case?5:
if?(manpoint[9].x==0)?manIndex=9;
else?manIndex=10;
break;
case?6:
if?(manpoint[11].x==0)?manIndex=11;
else?if?(manpoint[12].x==0)?manIndex=12;
else?if?(manpoint[13].x==0)?manIndex=13;
else?if?(manpoint[14].x==0)?manIndex=14;
else?manIndex=15;
break;
}
}
else
{
switch?(type)
{
case?0:
manIndex=16;
break;
case?1:
if?(manpoint[17].x==0)?manIndex=17;
else?manIndex=18;
break;
case?2:
if?(manpoint[19].x==0)?manIndex=19;
else?manIndex=20;
break;
case?3:
if?(manpoint[21].x==0)?manIndex=21;
else?manIndex=22;
break;
case?4:
if?(manpoint[23].x==0)?manIndex=23;
else?manIndex=24;
break;
case?5:
if?(manpoint[25].x==0)?manIndex=25;
else?manIndex=26;
break;
case?6:
if?(manpoint[27].x==0)?manIndex=27;
else?if?(manpoint[28].x==0)?manIndex=28;
else?if?(manpoint[29].x==0)?manIndex=29;
else?if?(manpoint[30].x==0)?manIndex=30;
else?manIndex=31;
break;
}
}
manpoint[manIndex].x=x;
manpoint[manIndex].y=y;
tmap[x][y]=manIndex;
index?+=?4;
}
//ShowInt(side);
//ShowInt(resultman);
//ShowInt(resultpoint.x);
//ShowInt(resultpoint.y);
BOOL?b=Think(?tm
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3518??2006-07-16?20:49??CChess?Source\CChessThinker\Calculate.cpp
?????文件????????127??2006-07-16?20:49??CChess?Source\CChessThinker\Calculate.h
?????文件????????354??2006-07-09?00:29??CChess?Source\CChessThinker\CChessThinker.cpp
?????文件???????5097??2006-12-01?21:28??CChess?Source\CChessThinker\CChessThinker.vcproj
?????文件?????????53??2006-07-10?20:24??CChess?Source\CChessThinker\dll.def
?????文件???????3978??2001-12-15?13:05??CChess?Source\CChessThinker\MantisChessDef.h
?????文件??????29080??2006-07-10?20:24??CChess?Source\CChessThinker\MantisChessThink.cpp
?????文件???????2091??2006-07-10?20:24??CChess?Source\CChessThinker\MantisChessThink.h
?????文件???????1253??2006-07-09?00:29??CChess?Source\CChessThinker\ReadMe.txt
?????文件????????216??2006-07-09?00:29??CChess?Source\CChessThinker\stdafx.cpp
?????文件???????1049??2006-07-09?00:29??CChess?Source\CChessThinker\stdafx.h
????..A.SHR???????439??2006-07-16?23:21??CChess?Source\CChessThinker\vssver2.scc
?????文件????????260??2006-12-02?12:14??CChess?Source\Game.gpState
?????文件???????3608??2006-12-02?12:12??CChess?Source\Game.sln
????..A..H.?????35328??2006-12-05?14:28??CChess?Source\Game.suo
????.......??????1075??2006-11-30?16:27??CChess?Source\GameWorld\app.config
????.......?????81920??2006-11-30?16:15??CChess?Source\GameWorld\CChessThinker.dll
????.......??????8045??2006-07-15?20:53??CChess?Source\GameWorld\ChineseChess\ChessMan.cs
????.......??????1298??2006-07-06?21:59??CChess?Source\GameWorld\ChineseChess\ChessMan.Designer.cs
????.......??????5814??2006-07-06?21:59??CChess?Source\GameWorld\ChineseChess\ChessMan.resx
?????文件???????8959??2006-12-05?11:16??CChess?Source\GameWorld\ChineseChess\ChineseChessControl.cs
????.......??????1262??2006-07-07?21:43??CChess?Source\GameWorld\ChineseChess\ChineseChessControl.Designer.cs
????.......??????5814??2006-07-05?23:59??CChess?Source\GameWorld\ChineseChess\ChineseChessControl.resx
?????文件????????489??2006-07-16?21:25??CChess?Source\GameWorld\ChineseChess\ChineseChessThinker.cs
?????文件??????18461??2006-12-05?11:16??CChess?Source\GameWorld\ChineseChess\Classes.cs
????.......???????766??2006-07-05?23:59??CChess?Source\GameWorld\ChineseChess\image\blackcannon.ico
????.......???????766??2006-07-05?23:59??CChess?Source\GameWorld\ChineseChess\image\blackchariot.ico
????.......???????766??2006-07-05?23:59??CChess?Source\GameWorld\ChineseChess\image\blackgeneral.ico
????.......???????766??2006-07-05?23:59??CChess?Source\GameWorld\ChineseChess\image\blackguard.ico
????.......???????766??2006-07-05?23:59??CChess?Source\GameWorld\ChineseChess\image\blackhorse.ico
............此處省略93個文件信息
評論
共有 條評論