⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mantischessdef.h

📁 MantisChess -- A Chinese Chess Program Copyright (C) Chen Chengtao, China This program is f
💻 H
字号:
/***************************************************************
  MantisChessDef.h : MantisChess 基本定义头文件

  版权所有(C)  陈成涛

  这一程序是自由软件,你可以遵照自由软件基金会出版的GNU通用公共
  许可证条款来修改和重新发布这一程序。或者用许可证的第二版,或者
  (根据你的选择)用任何更新的版本。

  发布这一程序的目的是希望它有用,但没有任何担保。甚至没有适合特
  定目的的隐含的担保。更详细的情况请参阅GNU通用公共许可证。
  
  你应该已经和程序一起收到一份GNU通用公共许可证的副本。
  如果还没有,写信给:

  The Free Software Foundation,Inc,,675 Mass Ave, Cambridge,
  MAO2139,USA

  如果你在使用本软件时有什么问题或建议,用以下地址可以与我取得联
  系:

              http://thecct.51.net

  或发Email到:

              stove@eyou.com
              thecct@163.com

------------------------------------------------------------------
  MantisChessDef.h : MantisChess standard defines headfile

  Copyright (C)  Chen Chengtao, China
  
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  
  If you have any question about this software please visit my hompage:

              http://thecct.51.net

  or E_mail to:

              stove@eyou.com
              thecct@163.com

******************************************************************/

const int MW=32,SW=1;				//MW-棋子宽度;SW-棋子间隔的一半
const int BWA=MW+SW*2;				//BWA-棋格宽度

const int XBW=BWA*9,YBW=BWA*10;		//棋盘的长宽

const int MAN=0;			//人
const int COM=1;			//计算机

const int RED=0;			//红方
const int BLACK=1;			//黑方

const int RED_K=0;			//红帅
const int RED_S=1;			//仕
const int RED_X=2;			//相
const int RED_M=3;			//马
const int RED_J=4;			//车
const int RED_P=5;			//炮
const int RED_B=6;			//兵

const int BLACK_K=7;		//黑将
const int BLACK_S=8;	//士
const int BLACK_X=9;		//象
const int BLACK_M=10;		//马
const int BLACK_J=11;		//车
const int BLACK_P=12;		//炮
const int BLACK_B=13;		//卒


//以下是全局函数定义:

//把棋子序号转换为对应图标的序号
const int  ManToIcon[33]=	{0,1,1,2,2,3,3,4,4,5,5,6,6,6,6,6
,7,8,8,9,9,10,10,11,11,12,12,13,13,13,13,13,-1};							

//棋子类型与图标的序号相同
#define ManToType  ManToIcon

const int ManToType7[33]=	{0,1,1,2,2,3,3,4,4,5,5,6,6,6,6,6
	,0,1,1,2,2,3,3,4,4,5,5,6,6,6,6,6,-1};


//随即函数,返回小于n的随机整数
int  rnd(const int& n);

//给出棋子序号!!,判断是红是黑
const int SideOfMan[33]=	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1};

const int _defaultmap[11][12]=	
{
//	[0][1][2][3][4][5][6][7][8][9][10][11]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[0]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[1]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[2]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[3]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[4]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[5]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[6]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[7]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[8]
	{32,32,32,32,32,32,32,32,32,32,32,32},//[9]
	{32,32,32,32,32,32,32,32,32,32,32,32}//[10]
};

const int FistOfSide[2]={0,16};
const int LastOfSide[2]={15,31};
const int MAXMOVE = 1000;

struct	MOVEHISTORY
{
	int		count;
	int		man[MAXMOVE];
	POINT	from[MAXMOVE];
	POINT	to[MAXMOVE];
	int		betaken[MAXMOVE];
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -