You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wuziqikechengsheji1801/C语言五子棋课程设计代码-黄智.cpp

151 lines
5.1 KiB

6 years ago
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#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);
char* Copy(char* strDest,const char* strSrc)
{
char* strDestCopy = strDest;
while (*strSrc!='\0')
{
*strDest++=*strSrc++;
}
return strDestCopy;
}
void Initialize()
{
int i,j;
showText="";
count=0;
for(i=0;i<MAXIMUS;i++)
{
for(j=0;j<MAXIMUS;j++)
{
p[i][j]=0;
}
}
Cx=Cy=MAXIMUS/2;
Now=1;
}
welcome() /*<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD>*/
{ Initialize(); /*<2A><>ʼ<EFBFBD><CABC>*/
system("cls"); /*<2A><><EFBFBD><EFBFBD>*/
system("color 2"); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ*/
system("mode con cols=504 lines=512");/*<2A><>ʽ*/
printf("\t<EFBFBD>X<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>[\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7>ף<EFBFBD><D7A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U ._______________________. <20>U\n");
printf("\t<EFBFBD>U | _____________________ | <20>U\n");
printf("\t<EFBFBD>U | I I | <20>U\n");
printf("\t<EFBFBD>U | I I | <20>U\n");
printf("\t<EFBFBD>U | I <20><> <20><> <20><> I | <20>U\n");
printf("\t<EFBFBD>U | I I | <20>U\n");
printf("\t<EFBFBD>U | I___________________I | <20>U\n");
printf("\t<EFBFBD>U !_______________________! <20>U\n");
printf("\t<EFBFBD>U ._[__________]_. <20>U\n");
printf("\t<EFBFBD>U .___|_______________|___. <20>U\n");
printf("\t<EFBFBD>U |::: ____ | <20>U\n");
printf("\t<EFBFBD>U | ~~~~ [CD-ROM] | <20>U\n");
printf("\t<EFBFBD>U !_____________________! <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20><EFBFBD><EBB0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20>U\n");
printf("\t<EFBFBD>U <20>|<7C>| <20>U\n");
printf("\t<EFBFBD>U <20>|<7C>| <20>U\n");
printf("\t<EFBFBD>U <20>|<7C>| <20>U\n");
printf("\t<EFBFBD>U <20>|<7C>| <20>U\n");
printf("\t<EFBFBD>^<5E>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>T<EFBFBD>a\n");
getch();
}
DoWin(int v)
{
int n;
Initialize();
system("cls"); /*<2A><><EFBFBD><EFBFBD>*/
system("color F0"); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ*/
if(v==1)
printf(" <20>ڷ<EFBFBD><DAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD> \n");
if(v==2)
printf(" <20>׷<EFBFBD><D7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD> \n");
printf("\n\n\t<EFBFBD>X<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[\n");
printf("\t<EFBFBD>U<EFBFBD><EFBFBD> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U һ <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U 1 <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U 2 <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>a\n");
scanf("%d",&n);
if(n==1)
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
if(n==2)
bye();
}
bye() /*say bye~@!,ʵ<>ֹ<EFBFBD><D6B9><EFBFBD>ͬ<EFBFBD><CDAC>*/
{
Initialize();
system("cls"); /*<2A><><EFBFBD><EFBFBD>*/
system("color 2"); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ*/
printf("\t<EFBFBD>X<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[\n");
printf("\t<EFBFBD>U <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U ллʹ<D0BB><CAB9> <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U <20><> <20>U\n");
printf("\t<EFBFBD>U л <20>U\n");
printf("\t<EFBFBD>U л <20>U\n");
printf("\t<EFBFBD>U <20>ټ<EFBFBD><D9BC><EFBFBD> <20>U\n");
printf("\t<EFBFBD>U <20>U\n");
printf("\t<EFBFBD>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>a\n");
exit(0);
}
int main()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{welcome();
help();
system("title C<><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨһ<CDA8><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");//<2F><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>
system("mode con cols=504 lines=512");//<2F><><EFBFBD>ô<EFBFBD><C3B4>ڴ<EFBFBD>С
system("color F0");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
while(1){//ѭ<><D1AD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>Ϸ
RunGame();
}
}