#include "stdio.h" /*自做五子棋程序*/
#include "graphics.h"
#include "conio.h"
#include<bios.h>
#define ESC 0x011b
#define SPACE 0x3920
#define RIGHT 0x4d00
#define DOWN 0x5000
#define UP 0x4800
#define LEFT 0x4b00
void fillbox();
void judgewin(int x,int y,int color2);
void change();
void draw_circle(int x,int y,int color1);
void judgecolor();
void movekey();
void menu();
int KEY,color,box[30][30];
int pointx,pointy;
int flag=0;
void menu()
{
char c;
window(1,1,80,25);
textbackground(WHITE);
textcolor(RED);
clrscr();
gotoxy(20,8);
cprintf("Do you want to start the game?");
gotoxy(25,10);
cprintf("Input YES(Y) or NO(N)");
while(1)
{ c=getche();
if(c=='Y'||c=='y')
break;
else if(c=='N'||c=='n')
exit(0);
}
}
void draw_box() /*画格子函数*/
{ int i,j,x0,y0,x1,y1;
setcolor(RED);
setlinestyle(0,0,5);
for(x0=40,y0=40,x1=580,y1=40;y0<=460;y0=y0+30,y1=y1+30)
line(x0,y0,x1,y1);
for(x0=40,y0=40,x1=40,y1=460;x0<=580;x0=x0+30,x1=x1+30)
line(x0,y0,x1,y1);
for(i=0;i<18;i++)
for(j=0;j<15;j++)
box[i][j]=0;
}
void fillbox() /*下子函数-赋值*/
{
if(color==WHITE)
box[pointx][pointy]=1;
else
box[pointx][pointy]=2;
}
void change() /*换人函数*/