chess.cpp

来自「用c++完成的五子棋」· C++ 代码 · 共 54 行

CPP
54
字号
// chess.cpp: implementation of the chess class.
//
//////////////////////////////////////////////////////////////////////
//其中一种颜色的棋子的类

#include "stdafx.h"
#include "wuziqi.h"
#include "chess.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

chess::chess()
{
	nCountkey=0;	

}

chess::~chess()
{

}

chess::keydown (int x,int y,int color)
{
	nCountkey++;
	nKeydown[nCountkey]=x*100+y;
	bqipan[x][y]=1;


	return 1;
}

void chess::clearall()
{
	int nCount1,nCount2;
	for(nCount1=0;nCount1<=17;nCount1++)
		for(nCount2=0;nCount2<=17;nCount2++)
		{
			bqipan[nCount1][nCount2]=0;
		}
	nCountkey=0;
	//nKeydown=-1;
}


⌨️ 快捷键说明

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