From 8c77aba13f614d5527e17e14485d262100251490 Mon Sep 17 00:00:00 2001 From: "1050367616@qq.com" <1050367616@qq.com> Date: Fri, 11 Jan 2019 08:59:58 +0800 Subject: [PATCH] first commit --- Gobang.c | 15 ++++++++------- Gobang.exe | Bin 141841 -> 141841 bytes 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gobang.c b/Gobang.c index 046d646..e531cca 100644 --- a/Gobang.c +++ b/Gobang.c @@ -5,13 +5,13 @@ #define N 100 -char c, j; -int score1=0, score2=0; +char c, j; //用于通过按键移动 +int score1=0, score2=0; //分数 int map[N][N]={0}; //定义棋盘的初始值为0 -void gamestart(); -void help(); -void gotoxy(int ,int ); +void gamestart(); //游戏开始界面 +void help(); //帮助界面,告知玩家如何操作 +void gotoxy(int ,int ); //控制光标的移动 void creatmap(); //画棋盘 void playchess(); //玩五子棋 int judge1(int ,int ); //判断玩家一是否连成五子 @@ -37,7 +37,7 @@ void gamestart() // gotoxy(45,18); printf("请按任意键进入帮助界面"); getch(); - system("cls"); + system("cls"); //清屏 help(); } @@ -463,7 +463,7 @@ void scoring(int x) { FILE* fp; char read[100]; - if((fp=fopen("score.txt","w+"))==NULL) + if((fp=fopen("score.txt","w+"))==NULL)//w+即可读写 { gotoxy(55,10); printf("The file can not be opened\n"); @@ -482,3 +482,4 @@ void scoring(int x) gotoxy(45,18); printf("%s",read); //输出文件内容 } + diff --git a/Gobang.exe b/Gobang.exe index 5d534ed246316951179ff704e8af451c3b0cb9ae..16183424fc573cb6c4a707795e590e5d61bbd087 100644 GIT binary patch delta 27 jcmbPug=69sjtL!1=U-0j@?(0-+IXw=7UR}iOy-&Zy5tPD delta 27 jcmbPug=69sjtL!1P0SO!{Fvs;H{NQ!#klnrles1UqpAx}