http://www.pudn.com/ [我的早知祥期C程序源代码]黑白棋 #include#include#include顷猛芹#include#include#include#include#include#include#include#include #define HH '0'#define N 6int Q=0;char key;int fine=1;int A=0,B=0;char s[N][N],m[N][N];void *ball;int maxx;unsigned int size;loading(){ int z=1;while(z) { if(z>77)break; printf("<"); delay(5000); z++; } delay(2000); cleardevice();}unsigned char Get_Ascii_Key(void){ if(bioskey(1)) return(bioskey(0)); else return(0);}int Test_Ascii_Key(int ascii){if(Get_Ascii_Key()==ascii)return(1);elsereturn(0);}void tu(){maxx=getmaxx();size=imagesize(210,390,450,420);ball=malloc(size);setfillstyle(1,10);bar(160,170,473,253);setfillstyle(1,9);bar(163,173,470,250);setcolor(13);outtextxy(200,200,"Welcome to BLACK & WHITE chess");setcolor(14);outtextxy(250,220,"Developer :Wu siyuan ");outtextxy(290,240,"2002.8");outtextxy(210,390,"Press any key to contunue...");getimage(210,390,450,420,ball);while(!kbhit()){ putimage(210,390,ball,XOR_PUT); delay(30000);}cleardevice();}void sou(void){}void print(){ int i=0,j=30; setcolor(11); outtextxy(35,20," 0 1 2 3 4 5"); outtextxy(14,50,"雀毕0"); outtextxy(14,100,"1"); outtextxy(14,150,"2"); outtextxy(14,200,"3"); outtextxy(14,250,"4"); outtextxy(14,300,"5"); setbkcolor(0); setlinestyle(SOLID_LINE,0,2); for(i=0;i<7;i++) { setcolor(GREEN); line (j,30,j,330); j+=50; } j=30; for(i=0;i<7;i++) { setcolor(GREEN); line(30,j,330,j); j+=50; }for(i=0;i<6;i++) for(j=0;j<6;j++) { if(s[i][j]=='o') { setcolor(WHITE); circle(55+j*50,55+i*50,15); } else if(s[i][j]=='x') { setcolor(RED); circle(55+j*50,55+i*50,15); } }}int cal(char z){ int *p=0; int num=0,i,j; for(i=0;i=0) { i=0; while(i=0) { i=0; while(i=0) {i=2; while(y+i=0)) {if(s[x-i][y+i]==z2){can[5]=1;break;} i++; } } if(s[x+1][y-1]==z1&&(y-1)>=0) {i=2; while(i=0)) {if(s[x+i][y-i]==z2) {can[6]=1;break;} i++; } } if(s[x-1][y-1]==z1&&(x-1)*(y-1)>=0) {i=2; while(x-i>=0&&y-i>=0) {if(s[x-i][y-i]==z2) {can[7]=1; break;} i++; } } if(s[x+1][y+1]==z1) {i=2; while(i+x=48&&a<=53){printf("\tGood! x has get!\n"); break;} } a=a-48; printf("Please input y (0 to 5):");while(1){ b=Get_Ascii_Key(); if(b==113||b==81) { printf("\nQuit?(y or Y)"); while(1) { if(Test_Ascii_Key(89)||Test_Ascii_Key(121)) exit(0); else if(Test_Ascii_Key(110)||Test_Ascii_Key(78)) break; }} if(b>=48&&a<=53){printf("\tGood! y has get!");break;} } b=b-48;Q=1; snew(a,b,'x','o'); Q=0; save();A=cal(g); B=cal('x');/* printf("\t\t\t\t\t\t\rA=%d,B=%d",A,B);*/}/* one */void search(){ int i,j,r=0; for(i=0;iB)outtextxy(400,200, " You win!"); else if(A 版权声明:文章由 百问九 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwen9.com/tips/254315.html