二十一点游戏设计报告(编辑修改稿)内容摘要:

outtextxy(120,60,What a pity!You rocord is lost!)。 } fscanf(fp ,%d,amp。 money)。 if(fclose(fp)){ settextstyle(TRIPLEX_FONT,HORIZ_DIR,2)。 outtextxy(120,60,What a pity!Can not save the money.)。 } } if(b==2) { if((fp=fopen(,r=))==NULL){ settextstyle(TRIPLEX_FONT,HORIZ_DIR,2)。 outtextxy(120,60,What a pity!You rocord is lost!)。 } fprintf(fp,%d,money)。 if(fclose(fp)){ settextstyle(TRIPLEX_FONT,HORIZ_DIR,2)。 outtextxy(120,60,What a pity!Can not save the money.)。 } } } /*调用游戏界面 */ void youxijiemian() { int x,y,p,graphdriver,graphmode。 char s[30]。 /*存放转换数据类型的数组 */ char a[8][2]={{0}}。 x=0。 p=0。 graphdriver=DETECT。 initgraph(amp。 graphdriver,amp。 graphmode,)。 cleardevice()。 setbkcolor(GREEN)。 setcolor(LIGHTGRAY)。 setfillstyle(1,YELLOW)。 arc(250,10,220,320,220)。 setcolor(7)。 setfillstyle(1,9)。 arc(250,10,220,320,200)。 setcolor(LIGHTGRAY)。 line(500,2,500,477)。 line(500,240,640,240)。 settextstyle(DEFAULT_FONT,HORIZ_DIR,2)。 outtextxy(178,30,COMPUTER)。 outtextxy(194,280,PLAYER)。 outtextxy(20,360,MONEY)。 outtextxy(540,65,KEY)。 outtextxy(20,250,WAGER)。 settextstyle(TRIPLEX_FONT,HORIZ_DIR,2)。 outtextxy(524,105,Enter is Start)。 outtextxy(524,135,Esc is Quit)。 outtextxy(524,165,Y is Yes)。 outtextxy(524,195,N is No)。 rectangle(20,380,90,420)。 setfillstyle(1,6)。 settextstyle(0,0,1)。 setcolor(YELLOW)。 sprintf(s,%d,money)。 outtextxy(30,395,s)。 rectangle(20,275,90,310)。 settextstyle(2,0,5)。 setfillstyle(1,5)。 settextstyle(0,0,1)。 settextstyle(TRIPLEX_FONT,HORIZ_DIR,2)。 a[x][0]=getch()。 /*输入筹码 */ while(a[x][0]!=13||x==0) { if(a[x][0]=39。 039。 amp。 amp。 a[x][0]=39。 939。 ){ outtextxy(25+x*8,295,a[x])。 x++。 } a[x][0]=getch()。 if(x==7amp。 amp。 a[x][0]!=13) a[x][0]=65。 } for(y=0。 yx。 y++) p=p*10+(a[y][0]39。 039。 )。 } /*调用发牌函 数 */ void fapai(){ int i。 int h,g。 h=g=2。 /*开始各发两张牌 */ player[0]=pai[0]。 player[1]=pai[1]。 paishu=2。 puter[0]=pai[5]。 puter[1]=pai[6]。 j=1。 m=1。 for(i=0。 i2。 i++){ wanjiapai(g)。 g++。 } for(i=0。 i2。 i++){ diannaopai(h)。 h++。 } j=2。 while(j5amp。 amp。 ky!=Key_N) /*显示提示,询问玩家是否要牌 */ { setcolor(RED)。 settextstyle(DEFAULT_FONT,HORIZ_DIR,2)。 outtextxy(524,300,CHOOSE)。 settextstyle(TRIPLEX_FONT,HORIZ_DIR,3)。 outtextxy(510,330, Do you want )。 outtextxy(510,350,another card?)。 outtextxy(510,385,Yes or No?)。 ky=bioskey(0)。 /*根据指令,决定是否发牌 */ switch(ky) { case Key_Y:{ player[j]=pai[j]。 wanjiapai(g)。 g++。 j++。 paishu++。 break。 } case Key_N:{ DN()。 break。 } default: break。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。