From aa177a9756094791a6ef1627a6e4783b8eae40ba Mon Sep 17 00:00:00 2001 From: unknown <13973508335@163.comgit config --global user.name 13973508335@163.com> Date: Thu, 10 Jan 2019 11:46:14 +0800 Subject: [PATCH] 3 commit --- ...五子棋课程设计代码-李得龙.cpp | 89 +++++++++++++++---- 画棋盘函数.cpp | 40 +++++++++ 2 files changed, 110 insertions(+), 19 deletions(-) rename C语言五子棋课程设计代码.cpp => C语言五子棋课程设计代码-李得龙.cpp (68%) create mode 100644 画棋盘函数.cpp diff --git a/C语言五子棋课程设计代码.cpp b/C语言五子棋课程设计代码-李得龙.cpp similarity index 68% rename from C语言五子棋课程设计代码.cpp rename to C语言五子棋课程设计代码-李得龙.cpp index b24c319..5114018 100644 --- a/C语言五子棋课程设计代码.cpp +++ b/C语言五子棋课程设计代码-李得龙.cpp @@ -1,21 +1,32 @@ -#include -#include -#include -#include -#define MAXIMUS 19 +#include +#include +#include +#include +#define MAXIMUS 19 //̴С #define W 0x1177 #define S 0x1f73 #define A 0x1e61 -#define D 0x2064 -int p[MAXIMUS][MAXIMUS]; -char buff[MAXIMUS*2+1][MAXIMUS*4+3]; -int Cx,Cy; -int Now; -int wl,wp; -char* showText; -int count; -int bye(); -int DoWin(int v); +#define D 0x2064//WSADļ +int p[MAXIMUS][MAXIMUS];//洢ԾϢ +char buff[MAXIMUS*2+1][MAXIMUS*4+3];// +int Cx,Cy;//ǰλ +int Now;//ǰӵң1ڣ2 +int wl,wp;//ǰд뻺λ +char* showText;//ʾϢ +int count;//غ +int RunGame(); +void welcome(); +void help(); +void bye(); +void DoWin(int v); +int ch,dh,del,n=0,m=0;/*ļƷֱ*/ +void Point();/*ļģ*/ + void p1_point_input();/*1pƷļȡ*/ + void p1_point_input2();/*1pƷļд*/ + void p1_point_output();/*1pƷļ*/ + void p2_point_input();/*2pƷļȡ*/ + void p2_point_input2();/*2pƷļд*/ + void p2_point_output();/*2pƷļ*/ char* Copy(char* strDest,const char* strSrc) { char* strDestCopy = strDest; @@ -40,7 +51,47 @@ p[i][j]=0; Cx=Cy=MAXIMUS/2; Now=1; } -welcome() /*ӭ*/ +char* getStyle(int i,int j)//ָ꽻λõַͨƱƴ +{ +if(p[i][j]==1)//1Ϊ +return ""; +else if(p[i][j]==2)//2Ϊ +return ""; +else if(i==0&&j==0)//ΪԵʽ +return ""; +else if(i==0&&j==MAXIMUS-1) +return ""; +else if(i==MAXIMUS-1&&j==0) +return ""; +else if(i==MAXIMUS-1&&j==MAXIMUS-1) +return ""; +else if(i==0) +return ""; +else if(i==MAXIMUS-1) +return ""; +else if(j==0) +return ""; +else if(j==MAXIMUS-1) +return ""; +return "";//мĿλ +} +char* getCurse(int i,int j){//ָ꽻λϸʽͨƱģʾ +if(i==Cx){ +if(j==Cy) +return ""; +else if (j==Cy+1) +return ""; +} +else if(i==Cx+1) +{ +if(j==Cy) +return ""; +else if (j==Cy+1) +return ""; +} +return "";//ڹ긽Ϊ +} +void welcome() /*ӭ*/ { Initialize(); /*ʼ*/ system("cls"); /**/ system("color 2"); /*ɫ*/ @@ -74,7 +125,7 @@ printf("\t printf("\t^TTTTTTTTTTTTTTTTTTa\n"); getch(); } -DoWin(int v) +void DoWin(int v) { int n; Initialize(); @@ -108,11 +159,11 @@ scanf("%d",&n); if(n==1) printf("밴"); if(n==2) -bye(); +void bye(); } int main()// {welcome(); -help(); +void help(); system("title CϷγ ͨһ");//ñ system("mode con cols=504 lines=512");//ôڴС system("color F0");//ɫ diff --git a/画棋盘函数.cpp b/画棋盘函数.cpp new file mode 100644 index 0000000..221aa30 --- /dev/null +++ b/画棋盘函数.cpp @@ -0,0 +1,40 @@ +char* getStyle(int i,int j)//ָ꽻λõַͨƱƴ +{ +if(p[i][j]==1)//1Ϊ +return ""; +else if(p[i][j]==2)//2Ϊ +return ""; +else if(i==0&&j==0)//ΪԵʽ +return ""; +else if(i==0&&j==MAXIMUS-1) +return ""; +else if(i==MAXIMUS-1&&j==0) +return ""; +else if(i==MAXIMUS-1&&j==MAXIMUS-1) +return ""; +else if(i==0) +return ""; +else if(i==MAXIMUS-1) +return ""; +else if(j==0) +return ""; +else if(j==MAXIMUS-1) +return ""; +return "";//мĿλ +} +char* getCurse(int i,int j){//ָ꽻λϸʽͨƱģʾ +if(i==Cx){ +if(j==Cy) +return ""; +else if (j==Cy+1) +return ""; +} +else if(i==Cx+1) +{ +if(j==Cy) +return ""; +else if (j==Cy+1) +return ""; +} +return "";//ڹ긽Ϊ +}