该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
blank(a);
step=1;
break;
case 'p':do{
clrscr();
printf("1.Play with computer.\n");
printf("2.Play with your friends.\n\nmake your choice:");
scanf("%c",&player);
fflush(stdin);
}while(player!='1'&&player!='2');
if(player=='1')
{
do{
clrscr();
printf("1.computer play first.\n");
printf("2.you play first.\n\nmake your choice:");
scanf("%c",&xian);
fflush(stdin);
}while(xian!='1'&&xian!='2');
}
else
{
do{
clrscr();
printf("1.your friend play first.\n");
printf("2.you play first.\n\nmake your choice:");
scanf("%c",&xian);
fflush(stdin);
}while(xian!='1'&&xian!='2');
}
saveplayer(&player,&xian);
break;
case 's':clrscr();
SaveData(a,step,pos);
savekey=1;
break;
case 'l':g:
clrscr();
if(savekey==0)
{
printf("\nthe game has not saved,save?(y n c)");
scanf("%c",&chose);
fflush(stdin);
if(chose=='y'||chose=='Y')
{
SaveData(a,step,pos);
savekey=1;
LoadData(a,&step,pos);
}
else if(chose=='n'||chose=='N')
{
LoadData(a,&step,pos);
savekey=1;
}
else if(chose=='c'||chose=='C') break;
else goto g;
}
else
{
LoadData(a,&step,pos);
savekey=1;
}
break;
case 't':clrscr();
track(a,&step,pos);
break;
case 'h':clrscr();
help();
getch();
break;
case 'c':clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\t\tCopyright 2006 www.superzheren.com All Right Reserved");
getch();
break;
case 'q':b:
clrscr();
if(savekey==0)
{
printf("\nthe game has not saved,save?(y n c)");
scanf("%c",&chose);
fflush(stdin);
if(chose=='y'||chose=='Y')
{
SaveData(a,step,pos);
return;
}
else if(chose=='n'||chose=='N')
{
return;
}
else if(chose=='c'||chose=='C') break;
else goto b;
}
else return;
default:if(check(a)==1) {printf("\nblack win!");break;}
if(check(a)==-1) {printf("\nwhite win!");break;}
savekey=0;
if(player=='1'&&xian=='1')
{
if(step%2==1) computer(a,step,pos);
else if(step%2==0) operate(a,c,step,pos);
}
else if(player=='1'&&xian=='2')
{
if(step%2==0) computer(a,step,pos);
else if(step%2==1) operate(a,c,step,pos);
}
else
{
operate(a,c,step,pos);
}
step++;
}
}
}