|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<conio.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#define MAXIMUS 19 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>С
|
|
|
|
|
int p[MAXIMUS][MAXIMUS];//<2F>洢<EFBFBD>Ծ<EFBFBD><D4BE><EFBFBD>Ϣ
|
|
|
|
|
char buff[MAXIMUS*2+1][MAXIMUS*4+3];//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int Cx,Cy;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
int Now;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>ң<EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int wl,wp;//<2F><>ǰд<C7B0>뻺<EFBFBD><EBBBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
char* showText;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
int count;//<2F>غ<EFBFBD><D8BA><EFBFBD>
|
|
|
|
|
char* Copy(char* strDest,const char* strSrc);//<2F>Ĺ<DEB8><C4B9><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĩ<EFBFBD>˵<EFBFBD>\0
|
|
|
|
|
void Initialize();//<2F><>ʼ<EFBFBD><CABC>һ<EFBFBD><D2BB><EFBFBD>Ծֺ<D4BE><D6BA><EFBFBD>
|
|
|
|
|
char* getStyle(int i,int j);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>꽻<EFBFBD><EABDBB>λ<EFBFBD>õ<EFBFBD><C3B5>ַ<EFBFBD><D6B7><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
char* getCurse(int i,int j);//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>꽻<EFBFBD><EABDBB>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ͨ<EFBFBD><CDA8><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
void write(char* c);//<2F><EFBFBD><F2BBBAB3><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|
|
|
|
void ln();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void Display();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ
|
|
|
|
|
void Print();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浽<EFBFBD><E6B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Display<61><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
|
|
int Put();//<2F>ڵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿգ<C7BF><D5A3><EFBFBD>0<EFBFBD><30>ʾʧ<CABE><CAA7>
|
|
|
|
|
int JugeWin();//ʤ<><CAA4><EFBFBD><EFBFBD><EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD>жϵ<D0B6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int RunGame();
|
|
|
|
|
void welcome();
|
|
|
|
|
void help();
|
|
|
|
|
void bye();
|
|
|
|
|
void DoWin(int v);
|
|
|
|
|
void huiqi(int (* p)[MAXIMUS],int num);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>庯<EFBFBD><E5BAAF>
|
|
|
|
|
int s1=0,s2=0;/*<2A>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒֱ<C6B7><D6B1><EFBFBD>*/
|
|
|
|
|
void p1_point();/*1p<31>Ʒ<EFBFBD><C6B7>ļ<EFBFBD><C4BC><EFBFBD>ȡ,1p<31>Ʒ<EFBFBD><C6B7>ļ<EFBFBD>д<EFBFBD><D0B4>,1p<31>Ʒ<EFBFBD><C6B7>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
void p2_point();/*2p<32>Ʒ<EFBFBD><C6B7>ļ<EFBFBD><C4BC><EFBFBD>ȡ,2p<32>Ʒ<EFBFBD><C6B7>ļ<EFBFBD>д<EFBFBD><D0B4>,2p<32>Ʒ<EFBFBD><C6B7>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
char* Copy(char* strDest,const char* strSrc)//<2F>Ĺ<DEB8><C4B9><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĩ<EFBFBD>˵<EFBFBD>\0
|
|
|
|
|
{
|
|
|
|
|
char* strDestCopy = strDest;
|
|
|
|
|
while (*strSrc!='\0')
|
|
|
|
|
{
|
|
|
|
|
*strDest++=*strSrc++;
|
|
|
|
|
}
|
|
|
|
|
return strDestCopy;
|
|
|
|
|
}
|
|
|
|
|
void Initialize()//<2F><>ʼ<EFBFBD><CABC>һ<EFBFBD><D2BB><EFBFBD>Ծֺ<D4BE><D6BA><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int i,j;//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
showText="";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣ
|
|
|
|
|
count=0;//<2F>غ<EFBFBD><D8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
for(i=0;i<MAXIMUS;i++)//<2F><><EFBFBD>öԾ<C3B6><D4BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
for(j=0;j<MAXIMUS;j++)
|
|
|
|
|
{
|
|
|
|
|
p[i][j]=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Cx=Cy=MAXIMUS/2;//<2F><><EFBFBD>ù<EFBFBD><C3B9>굽<EFBFBD><EAB5BD><EFBFBD><EFBFBD>
|
|
|
|
|
Now=1;//<2F><><EFBFBD>õ<EFBFBD>ǰΪ<C7B0>ڷ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
char* getStyle(int i,int j)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>꽻<EFBFBD><EABDBB>λ<EFBFBD>õ<EFBFBD><C3B5>ַ<EFBFBD><D6B7><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(p[i][j]==1)//1Ϊ<31><CEAA><EFBFBD><EFBFBD>
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(p[i][j]==2)//2Ϊ<32><CEAA><EFBFBD><EFBFBD>
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(i==0&&j==0)//<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(i==0&&j==MAXIMUS-1)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(i==MAXIMUS-1&&j==0)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(i==MAXIMUS-1&&j==MAXIMUS-1)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(i==0)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(i==MAXIMUS-1)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(j==0)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if(j==MAXIMUS-1)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
return "<EFBFBD><EFBFBD>";//<2F>м<EFBFBD><D0BC>Ŀ<EFBFBD>λ
|
|
|
|
|
}
|
|
|
|
|
char* getCurse(int i,int j)//<2F><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>꽻<EFBFBD><EABDBB>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>ͨ<EFBFBD><CDA8><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
{
|
|
|
|
|
if(i==Cx){
|
|
|
|
|
if(j==Cy)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if (j==Cy+1)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
}
|
|
|
|
|
else if(i==Cx+1)
|
|
|
|
|
{
|
|
|
|
|
if(j==Cy)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
else if (j==Cy+1)
|
|
|
|
|
return "<EFBFBD><EFBFBD>";
|
|
|
|
|
}
|
|
|
|
|
return "<EFBFBD><EFBFBD>";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD><DAB9>긽<EFBFBD><EAB8BD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
|
|
|
|
|
}
|
|
|
|
|
void write(char* c)//<2F><EFBFBD><F2BBBAB3><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
Copy(buff[wl]+wp,c);
|
|
|
|
|
wp+=strlen(c);
|
|
|
|
|
}
|
|
|
|
|
void ln()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
wl+=1;
|
|
|
|
|
wp=0;
|
|
|
|
|
}
|
|
|
|
|
void Display()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ
|
|
|
|
|
{
|
|
|
|
|
int i,l=strlen(showText);//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
|
|
|
|
int Offset=MAXIMUS*2+2-l/2;//<2F><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ڵĺ<DAB5><C4BA><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
if(Offset%2==1)//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>ż<EFBFBD><C5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
Offset--;
|
|
|
|
|
}
|
|
|
|
|
Copy(buff[MAXIMUS]+Offset,showText);//<2F><><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if(l%2==1)//<2F><><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD>ֳ<EFBFBD><D6B3><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽո<D5B8><F1A3ACB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
*(buff[MAXIMUS]+Offset+l)=0x20;
|
|
|
|
|
}
|
|
|
|
|
system("cls");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><D7BC>д<EFBFBD><D0B4>
|
|
|
|
|
for(i=0;i<MAXIMUS*2+1;i++){//ѭ<><D1AD>д<EFBFBD><D0B4>ÿһ<C3BF><D2BB>
|
|
|
|
|
printf("%s",buff[i]);
|
|
|
|
|
if(i<MAXIMUS*2)//д<><D0B4><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void Print()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浽<EFBFBD><E6B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Display<61><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int i,j;//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
wl=0;
|
|
|
|
|
wp=0;
|
|
|
|
|
for(j=0;j<=MAXIMUS;j++)//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͻǵ<CFBD><C7B5>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>Ҫ<EFBFBD><D2AA>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½ǣ<C2BD><C7A3><EFBFBD><EFBFBD>Ժ<EFBFBD><D4BA>Ժ<EFBFBD><D4BA>ݸ<EFBFBD><DDB8><EFBFBD>һ<EFBFBD><D2BB>ѭ<EFBFBD><D1AD>
|
|
|
|
|
{
|
|
|
|
|
for(i=0;i<=MAXIMUS;i++)
|
|
|
|
|
{
|
|
|
|
|
write(getCurse(i,j));//д<><D0B4><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD>ַ<EFBFBD>
|
|
|
|
|
if(j==0||j==MAXIMUS)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD>Ե<EFBFBD><D4B5>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>ߣ<EFBFBD><DFA3>ÿո<C3BF><D5B8><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
{
|
|
|
|
|
if(i!=MAXIMUS)
|
|
|
|
|
write("<EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
else//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳н<DFB3><D0BD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(i==0||i==MAXIMUS-1)//<2F><><EFBFBD>ұ<EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD><DFB8><EFBFBD>
|
|
|
|
|
write("<EFBFBD><EFBFBD>");
|
|
|
|
|
else if(i!=MAXIMUS)//<2F>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
write("<EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(j==MAXIMUS)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>߲<EFBFBD><DFB2>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>һ<EFBFBD><D2BB>
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
ln();//<2F><><EFBFBD>п<EFBFBD>ʼ<EFBFBD><CABC>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
write("<EFBFBD><EFBFBD>");//<2F>ÿ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
for(i=0;i<MAXIMUS;i++)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
write(getStyle(i,j));//д<>뽻<EFBFBD><EBBDBB><EFBFBD>ַ<EFBFBD>
|
|
|
|
|
if(i!=MAXIMUS-1)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>߳н<DFB3><D0BD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(j==0||j==MAXIMUS-1)
|
|
|
|
|
{
|
|
|
|
|
write("<EFBFBD><EFBFBD>");//<2F><><EFBFBD>±<EFBFBD>Ե<EFBFBD>ĺ<EFBFBD><C4BA>߸<EFBFBD><DFB8><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
write("<EFBFBD><EFBFBD>");//<2F>м<EFBFBD><D0BC>ĺ<EFBFBD><C4BA><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ln();//д<><D0B4>һ<EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
Display();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ
|
|
|
|
|
}
|
|
|
|
|
int Put()//<2F>ڵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿգ<C7BF><D5A3><EFBFBD>0<EFBFBD><30>ʾʧ<CABE><CAA7>
|
|
|
|
|
{
|
|
|
|
|
if(p[Cx][Cy]==0)
|
|
|
|
|
{
|
|
|
|
|
p[Cx][Cy]=Now;//<2F>ı<EFBFBD><C4B1><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
return 1;//<2F><><EFBFBD><EFBFBD>1<EFBFBD><31>ʾ<EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int JugeWin()//ʤ<><CAA4><EFBFBD><EFBFBD><EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD>жϵ<D0B6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
int w=1,x=1,y=1,z=1,i;//<2F>ۼƺ<DBBC><C6BA><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>а<EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
|
|
|
|
|
for(i=1;i<5;i++)if(Cy+i<MAXIMUS&&p[Cx][Cy+i]==Now)w++;else break;//<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>
|
|
|
|
|
for(i=1;i<5;i++)if(Cy-i>0&&p[Cx][Cy-i]==Now)w++;else break;//<2F><><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>
|
|
|
|
|
if(w>=5)return Now;//<2F><><EFBFBD><EFBFBD><EFBFBD>ﵽ5<EFB5BD><35><EFBFBD><EFBFBD><EFBFBD>жϵ<D0B6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪӮ<CEAA><D3AE>
|
|
|
|
|
for(i=1;i<5;i++)if(Cx+i<MAXIMUS&&p[Cx+i][Cy]==Now)x++;else break;//<2F><><EFBFBD>Ҽ<EFBFBD><D2BC><EFBFBD>
|
|
|
|
|
for(i=1;i<5;i++)if(Cx-i>0&&p[Cx-i][Cy]==Now)x++;else break;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if(x>=5)return Now;//<2F><><EFBFBD><EFBFBD><EFBFBD>ﵽ5<EFB5BD><35><EFBFBD><EFBFBD><EFBFBD>жϵ<D0B6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪӮ<CEAA><D3AE>
|
|
|
|
|
for(i=1;i<5;i++)if(Cx+i<MAXIMUS&&Cy+i<MAXIMUS&&p[Cx+i][Cy+i]==Now)y++;else break;//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>
|
|
|
|
|
for(i=1;i<5;i++)if(Cx-i>0&&Cy-i>0&&p[Cx-i][Cy-i]==Now)y++;else break;//<2F><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>
|
|
|
|
|
if(y>=5)return Now;//<2F><><EFBFBD><EFBFBD><EFBFBD>ﵽ5<EFB5BD><35><EFBFBD><EFBFBD><EFBFBD>жϵ<D0B6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪӮ<CEAA><D3AE>
|
|
|
|
|
for(i=1;i<5;i++)if(Cx+i<MAXIMUS&&Cy-i>0&&p[Cx+i][Cy-i]==Now)z++;else break;//<2F><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>
|
|
|
|
|
for(i=1;i<5;i++)if(Cx-i>0&&Cy+i<MAXIMUS&&p[Cx-i][Cy+i]==Now)z++;else break;//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>
|
|
|
|
|
if(z>=5)return Now;//<2F><><EFBFBD><EFBFBD><EFBFBD>ﵽ5<EFB5BD><35><EFBFBD><EFBFBD><EFBFBD>жϵ<D0B6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪӮ<CEAA><D3AE>
|
|
|
|
|
return 0;//<2F><>û<EFBFBD>м<EFBFBD><D0BC>鵽<EFBFBD><E9B5BD><EFBFBD><EFBFBD><EFBFBD>飬<EFBFBD><EFBFBD>0<EFBFBD><30>ʾ<EFBFBD><CABE>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>ʤ<EFBFBD><CAA4>
|
|
|
|
|
}
|
|
|
|
|
int RunGame()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ծ֣<D4BE><D6A3><EFBFBD><EFBFBD><EFBFBD>Ӯ<EFBFBD><D3AE><EFBFBD><EFBFBD>Ϣ(<28><>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
{
|
|
|
|
|
int input;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int victor;//Ӯ<><D3AE><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
Initialize();//<2F><>ʼ<EFBFBD><CABC><EFBFBD>Ծ<EFBFBD>
|
|
|
|
|
while(1){//<2F><>ʼ<EFBFBD><CABC><EFBFBD>غϵ<D8BA><CFB5><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if(Now==1)
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫΪ<EFBFBD><EFBFBD>ɫ");
|
|
|
|
|
if(Now==2)
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫΪ<EFBFBD><EFBFBD>ɫ");
|
|
|
|
|
Print();//<2F><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>
|
|
|
|
|
input=getch();//<2F>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD>̰<EFBFBD><CCB0><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>
|
|
|
|
|
if(input==27)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ESC<53><43><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
else if(input==8)
|
|
|
|
|
{
|
|
|
|
|
huiqi(p,Now);
|
|
|
|
|
Now=3-Now;
|
|
|
|
|
}
|
|
|
|
|
else if(input==0x20&&Now==1||input==13&&Now==2)//<2F><><EFBFBD><EFBFBD><EFBFBD>ǿո<C7BF><D5B8><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(Put())//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD><EFBFBD>ж<EFBFBD>ʤ<EFBFBD><CAA4>
|
|
|
|
|
{
|
|
|
|
|
victor=JugeWin();
|
|
|
|
|
Now=3-Now;//<2F>ֻ<EFBFBD><D6BB><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
count++;
|
|
|
|
|
if(victor==1)//<2F><><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD><DAB7>ﵽʤ<EFB5BD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ʾ<EFBFBD><CABE><EFBFBD>ֲ<EFBFBD><D6B2>ȴ<EFBFBD>һ<EFBFBD>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
DoWin(victor);
|
|
|
|
|
if(getch()==0xE0)
|
|
|
|
|
{
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
return Now;
|
|
|
|
|
}
|
|
|
|
|
else if(victor==2)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7B7>ﵽʤ<EFB5BD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ʾ<EFBFBD><CABE><EFBFBD>ֲ<EFBFBD><D6B2>ȴ<EFBFBD>һ<EFBFBD>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
{
|
|
|
|
|
DoWin(victor);
|
|
|
|
|
if(getch()==0xE0)
|
|
|
|
|
{
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
return Now;
|
|
|
|
|
}
|
|
|
|
|
else if(count==MAXIMUS*MAXIMUS)//<2F><><EFBFBD><EFBFBD><EFBFBD>غ<EFBFBD><D8BA><EFBFBD><EFBFBD>ﵽ<EFBFBD><EFB5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><CCB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊƽ<CEAA><C6BD>
|
|
|
|
|
{
|
|
|
|
|
showText="ƽ<EFBFBD>֣<EFBFBD>";
|
|
|
|
|
Display();
|
|
|
|
|
if(getch()==0xE0)
|
|
|
|
|
{
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(Now==2&&input==0xE0)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC>һ<EFBFBD><D2BB>Ϊ0xE0<45><30>ʾ<EFBFBD><CABE><EFBFBD>µ<EFBFBD><C2B5>ǿ<EFBFBD><C7BF>Ƽ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
input=getch();//<2F><><EFBFBD>õڶ<C3B5><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
switch(input)//<2F>жϷ<D0B6><CFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
{
|
|
|
|
|
case 0x4B: Cx--;break;
|
|
|
|
|
case 0x48: Cy--;break;
|
|
|
|
|
case 0x4D: Cx++;break;
|
|
|
|
|
case 0x50: Cy++;break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(Now==1)
|
|
|
|
|
{
|
|
|
|
|
switch(input)//<2F>ж<EFBFBD>w,s,a,d<><64><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
{
|
|
|
|
|
case 'a': Cx--;break;
|
|
|
|
|
case 'w': Cy--;break;
|
|
|
|
|
case 'd': Cx++;break;
|
|
|
|
|
case 's': Cy++;break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(Cx<0)Cx=MAXIMUS-1;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>Բ<EFBFBD>
|
|
|
|
|
if(Cy<0)Cy=MAXIMUS-1;
|
|
|
|
|
if(Cx>MAXIMUS-1)Cx=0;
|
|
|
|
|
if(Cy>MAXIMUS-1)Cy=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void 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("\n\n\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>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();
|
|
|
|
|
}
|
|
|
|
|
void help() /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬwelcome();<EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
{
|
|
|
|
|
Initialize();
|
|
|
|
|
system("cls"); /*<2A><><EFBFBD><EFBFBD>*/
|
|
|
|
|
system("color 2"); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ*/
|
|
|
|
|
system("mode con cols=504 lines=512");/*<2A><>ʽ*/
|
|
|
|
|
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD>W<EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U A<><41><EFBFBD><EFBFBD>D<EFBFBD><44><EFBFBD>ң<EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD><EFBFBD><EFBFBD>壺<EFBFBD>ո<EFBFBD><EFBFBD><EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD><EFBFBD><EFBFBD>壺<EFBFBD>س<EFBFBD><EFBFBD><EFBFBD> <20>U\n");
|
|
|
|
|
printf("\t<EFBFBD>U<EFBFBD><EFBFBD><EFBFBD>壺Backspace<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><> <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>^<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");
|
|
|
|
|
getch();
|
|
|
|
|
}
|
|
|
|
|
void 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");
|
|
|
|
|
p1_point();
|
|
|
|
|
}
|
|
|
|
|
if(v==2)
|
|
|
|
|
{
|
|
|
|
|
printf(" <20><EFBFBD><D7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD> \n");
|
|
|
|
|
p2_point();
|
|
|
|
|
}
|
|
|
|
|
printf("\n\n\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();
|
|
|
|
|
}
|
|
|
|
|
void 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);
|
|
|
|
|
}
|
|
|
|
|
void huiqi(int (* p)[MAXIMUS],int num)//<2F><><EFBFBD>庯<EFBFBD><E5BAAF>
|
|
|
|
|
{
|
|
|
|
|
int i,j;
|
|
|
|
|
for(i=0;i<MAXIMUS;i++)
|
|
|
|
|
{
|
|
|
|
|
for(j=0;j<MAXIMUS;j++)
|
|
|
|
|
{
|
|
|
|
|
if(p[i][j]!=num&&i==Cx&&j==Cy)
|
|
|
|
|
p[i][j]=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void p1_point()//<2F><><EFBFBD><EFBFBD>һ<EFBFBD>Ʒֺ<C6B7><D6BA><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fp=fopen("score1.txt","w+");
|
|
|
|
|
s1++;
|
|
|
|
|
fprintf(fp,"%d",s1);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
int i;
|
|
|
|
|
fp=fopen("score1.txt","r");
|
|
|
|
|
fscanf(fp,"%d",&i);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ĵ÷<EFBFBD>=%d",i);
|
|
|
|
|
}
|
|
|
|
|
void p2_point()
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fp=fopen("score2.txt","w+");
|
|
|
|
|
s2++;
|
|
|
|
|
fprintf(fp,"%d",s2);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
int i;
|
|
|
|
|
fp=fopen("score2.txt","r");
|
|
|
|
|
fscanf(fp,"%d",&i);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD><EFBFBD>ĵ÷<EFBFBD>=%d",i);
|
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|