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

📄 turnover.h

📁 labview经典实例
💻 H
字号:

int Turn_Over_Next_chess(int chessBoard[8][8], int chessColor, int selfRow, 
						 int selfColumn, int neighbourRow, int neighbourColumn)
{
	int couldTurn= 0;
	int currentColor;
	selfRow+=neighbourRow;  selfColumn+=neighbourColumn;
	if ((selfRow>0)&&(selfRow<7)&&(selfColumn>0)&&(selfColumn<7)) 
	{
		currentColor=chessBoard[selfRow][selfColumn];
		if (currentColor>10)
			if (chessColor!=currentColor)
				couldTurn=Turn_Over_Next_chess(chessBoard, chessColor, 
												selfRow, selfColumn, 
												neighbourRow, neighbourColumn);
			else couldTurn=1;
	}
	if (couldTurn) chessBoard[selfRow][selfColumn]=chessColor;
	return (couldTurn);
}


	



void Turn_Over_Chesses(int chessBoard[8][8], int chessColor, int row, int column)
{
	chessBoard[row][column]=chessColor;
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, -1, -1); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, -1, 0); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, -1, 1); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, 0, -1); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, 0, 1); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, 1, -1); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, 1, 0); 
	Turn_Over_Next_chess(chessBoard, chessColor, row, column, 1, 1); 
}


⌨️ 快捷键说明

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