?? define.h
字號:
// COPYRIGHT NOTES
// ---------------
// This source code is a part of chess which is an example of <Game Programing guide>.
// You may use, compile or redistribute it as part of your application
// for free.
// You cannot redistribute sources without the official agreement of the author.
// If distribution of you application which contents code below was occured, place
// e-mail <hidebug@hotmail.com> on it is to be appreciated.
// This code can be used WITHOUT ANY WARRANTIES on your own risk.
//
// Spring Wang <hidebug@hotmail.com>
// ---------------
// 版權聲明
// ---------------
// 本文件所含之代碼是《人機博弈程序設計指南》的范例程序中國象棋的一部分
// 您可以免費的使用, 編譯 或者作為您應用程序的一部分。
// 但,您不能在未經作者書面許可的情況下分發(fā)此源代碼。
// 如果您的應用程序使用了這些代碼,在您的應用程序界面上
// 放入 e-mail <hidebug@hotmail.com> 是令人欣賞的做法。
// 此代碼并不含有任何保證,使用者當自承風險。
//
// 王小春 <hidebug@hotmail.com>
//define.h // data structure and macros
#ifndef define_h_
#define define_h_
#define NOCHESS 0 //沒有棋子
#define B_KING 1 //黑帥
#define B_CAR 2 //黑車
#define B_HORSE 3 //黑馬
#define B_CANON 4 //黑炮
#define B_BISHOP 5 //黑士
#define B_ELEPHANT 6 //黑象
#define B_PAWN 7 //黑卒
#define B_BEGIN B_KING
#define B_END B_PAWN
#define R_KING 8 //紅帥
#define R_CAR 9 //紅車
#define R_HORSE 10 //紅馬
#define R_CANON 11 //紅炮
#define R_BISHOP 12 //紅士
#define R_ELEPHANT 13 //紅象
#define R_PAWN 14 //紅兵
#define R_BEGIN R_KING
#define R_END R_PAWN
#define IsBlack(x) (x>=B_BEGIN&&x<=B_END)
#define IsRed(x) (x>=R_BEGIN&&x<=R_END)
#define IsSameSide(x,y) ((IsBlack(x)&&IsBlack(y))||(IsRed(x)&&IsRed(y)))
typedef struct _chessmanposition
{
BYTE x;
BYTE y;
}CHESSMANPOS;
typedef struct _chessmove
{
short ChessID; //
CHESSMANPOS From;
CHESSMANPOS To; //
int Score; //
}CHESSMOVE;
#endif //define_h_
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -