首页 > > 详细

讲解五子棋代码对战系统程序、C语言讲解留学生、讲解五子棋C语言

/**
* :,
*/
#include
#include
#include
#include
#define random(x) (rand()%x)
#include
using namespace std;
#define TIME_DELAY 100
#define MAP_SIZE 15
enum ChessType{
EMPTY=0,
WHITE=1,
BLACK=2
};
// ,
class Player{
private:
ChessType type;
public:
// :1203
string getDesc(){
return "";
}
//
void setChessType(ChessType t){type=t;}
// :,!
string getWinText(){
return "";
}
// :!
string getLoseText(){
return "";
}
//
void nextMove(ChessType chessMap[MAP_SIZE][MAP_SIZE],int row,int col){
}
// ,
static bool isMoveValid(ChessType chessMap[MAP_SIZE][MAP_SIZE],int row,int col){
return row>=0row=0col=4 isetChessType(WHITE);
black->setChessType(BLACK);
Map_Init();
while(1){
// system("cls");
gotoxy(0,0);
cout getDesc() getDesc() nextMove(chessmap,r,c);
// system("cls");
// coutgetLoseText() getWinText() getWinText() getLoseText() nextMove(chessmap,r,c);
gotoxy(2,0);
cout getLoseText() getWinText() getWinText() getLoseText() << endl;
break;
}
// 1
Sleep(TIME_DELAY);
}
return 0;
}
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!