|
|
@ -5,13 +5,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
#define N 100
|
|
|
|
#define N 100
|
|
|
|
|
|
|
|
|
|
|
|
char c, j;
|
|
|
|
char c, j; //用于通过按键移动
|
|
|
|
int score1=0, score2=0;
|
|
|
|
int score1=0, score2=0; //分数
|
|
|
|
int map[N][N]={0}; //定义棋盘的初始值为0
|
|
|
|
int map[N][N]={0}; //定义棋盘的初始值为0
|
|
|
|
|
|
|
|
|
|
|
|
void gamestart();
|
|
|
|
void gamestart(); //游戏开始界面
|
|
|
|
void help();
|
|
|
|
void help(); //帮助界面,告知玩家如何操作
|
|
|
|
void gotoxy(int ,int );
|
|
|
|
void gotoxy(int ,int ); //控制光标的移动
|
|
|
|
void creatmap(); //画棋盘
|
|
|
|
void creatmap(); //画棋盘
|
|
|
|
void playchess(); //玩五子棋
|
|
|
|
void playchess(); //玩五子棋
|
|
|
|
int judge1(int ,int ); //判断玩家一是否连成五子
|
|
|
|
int judge1(int ,int ); //判断玩家一是否连成五子
|
|
|
@ -37,7 +37,7 @@ void gamestart() //
|
|
|
|
gotoxy(45,18);
|
|
|
|
gotoxy(45,18);
|
|
|
|
printf("请按任意键进入帮助界面");
|
|
|
|
printf("请按任意键进入帮助界面");
|
|
|
|
getch();
|
|
|
|
getch();
|
|
|
|
system("cls");
|
|
|
|
system("cls"); //清屏
|
|
|
|
help();
|
|
|
|
help();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -463,7 +463,7 @@ void scoring(int x)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FILE* fp;
|
|
|
|
FILE* fp;
|
|
|
|
char read[100];
|
|
|
|
char read[100];
|
|
|
|
if((fp=fopen("score.txt","w+"))==NULL)
|
|
|
|
if((fp=fopen("score.txt","w+"))==NULL)//w+即可读写
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gotoxy(55,10);
|
|
|
|
gotoxy(55,10);
|
|
|
|
printf("The file can not be opened\n");
|
|
|
|
printf("The file can not be opened\n");
|
|
|
@ -482,3 +482,4 @@ void scoring(int x)
|
|
|
|
gotoxy(45,18);
|
|
|
|
gotoxy(45,18);
|
|
|
|
printf("%s",read); //输出文件内容
|
|
|
|
printf("%s",read); //输出文件内容
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|