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

📄 moves.h

📁 EVC4.0开发的国际象棋的元代码
💻 H
字号:
/****************************************************
Author: S. Senthil kumar
Class Name: Moves
Purpose:    To Generate Moves and store in a linked list

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

class Moves
{
	
public:
	OneMove *head;						//Head of the linked list
	OneMove *current;					//Current node in the linked list
	OneMove *acurrent;OneMove *ncurrent;//Current nodes in attack list, quiscent list
	OneMove *attackhead;				//Head of attack list
	OneMove *normalhead;				//Head of quiscent list
	int tempboard[8][8];				//Temporary board
	int size;							//Total Size of the linked list (ie) Total moves generated
	
	
	/*To add a move to the linked list
	Arguments:
		p: piece Id
		sourcex,sourcey: Starting square
		dx,dy:		   : Destination square
		noa			   : Boolean variable to indicate whether attacking or quiscent move
	*/
	void add(int p,int sourcex,int sourcey,int dx,int dy,int noa);
	
	
	/*Constructor*/
	Moves();


	
	/*Combines attack list and quiscent list with attack list at the head*/
	void combine();
	
	
	/*Destroys the linked list of moves*/ 
	void destroy();
	
	
	/*Main move generating routines
	  Arguments:
		board[8][8] : Current board
		int color	: To Generate for white or black
	*/
	void GeneratePawnMoves(int board[8][8],int color);
	void GenerateKnightMoves(int board[8][8],int color);
	void GenerateBishopMoves(int board[8][8],int color);
	void GenerateRookMoves(int board[8][8],int color);
	void GenerateQueenMoves(int board[8][8],int color);
	void GenerateKingMoves(int board[8][8],int color);

	
	/*Driver Routine*/
	int GenerateAllMoves(int board[8][8],int color,int depth,int check_for_mate);
};

⌨️ 快捷键说明

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