freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c語言課程設計報告——貪吃蛇源程序-閱讀頁

2025-05-28 18:24本頁面
  

【正文】 D_FILL,15)。isnownum。 putimage(snow[i].x,snow[i].y,save,COPY_PUT)。}change++。 }nosound()。/*清屏*/}/*圖像系統(tǒng)初始化函數(shù)*/void init(void) { int gd=DETECT,gm。gd,amp。 cleardevice()。 setcolor(BLUE)。 /*設置線性*/ for(i=50。i+=10) /*用循環(huán)畫圍墻*/ {setcolor(2*i+1)。 /*畫上邊*/ circle(i,451,5)。 /*畫下邊*/ } for(i=40。i+=10) {setcolor(2*i+1)。 /*畫左邊*/ circle(601,i,5)。i=460。 circle(41,i,5)。 } setcolor(LIGHTCYAN)。 outtextxy(20,5, GREEDY SNAKE GAMES ji 11_1)。 /*輸出此文本*/} /*玩游戲具體過程*/void gameplay(void) {=1。 /*蛇活著*/ int level=1。 /*字符數(shù)組用于轉(zhuǎn)換整形數(shù)據(jù)*/ randomize()。 /*方向向右*/ [0]=110。 /*蛇頭坐標初值*/ [1]=100。 /*蛇身1節(jié)坐標初值*/ [2]=90。 /*蛇身2節(jié)坐標初值*/ =3。 /*在墻內(nèi)隨機產(chǎn)生蘋果橫坐標*/ =rand()%350+60。 while(%10!=0) ++。 /*畫面上有蘋果了*/ } if(==0) /*畫面上有蘋果就要畫出來*/ {setcolor(GREEN)。 circle(,5)。 } setfillstyle(1,BLUE)。 /*畫出顯示分數(shù)及關數(shù)藍色矩形條*/ setcolor(WHITE)。 /*將整形數(shù)據(jù)分數(shù)轉(zhuǎn)換成字符串*/ outtextxy(480,20,buffer)。 /*將整形數(shù)據(jù)關數(shù)轉(zhuǎn)換成字符串*/ outtextxy(560,20,buffer)。i0。 [i]=[i1]。break。break。break。break。 /*置蛇死標志*/ break。i。amp。 /*置蛇死標志*/ break。 /*跳出while(!kbhit)*/ if([0]==amp。[0]==) /*吃到蘋果以后*/ {setcolor(BLACK)。 ++。 /*畫面上需要出現(xiàn)新的蘋果*/ score+=10。 /*關數(shù)加1*/ gamespeed=60。 /*畫出紅色蛇的循環(huán)*/ setfillstyle(SOLID_FILL,RED)。 setcolor(GREEN)。 circle([0],[0],1)。 setfillstyle(SOLID_FILL,BLUE)。i。 setfillstyle(SOLID_FILL,BLUE)。 /*對每節(jié)蛇身用藍色填充*/ setcolor(CYAN)。 /*用青色小圓畫在每節(jié)蛇身上*/ } delay(gamespeed)。 /*用背景色黑色去除蛇的最后一節(jié)*/ circle([],[],5) 。 fillellipse([],[],5,5)。 /*如果蛇死就跳出循環(huán)*/ key=bioskey(0)。 /*按esc鍵退出*/ /*判斷是否往相反的方向運動*/   else if(key==upamp。!=4) =3。amp。 else if(key==leftamp。!=1) =2。amp。 } /*endwhile(1)*/} /*結(jié)束游戲*/ /*讀取文件操作函數(shù)*/void readfiles() {FILE * fpread。t open the file ! )。 } if(fgetc(fpread)==EOF) /*如果文件內(nèi)容為空*/ initscorefiles()。 /*重新復位文件位置指針*/ fread(per,sizeof(struct person),5,fpread)。 /*關閉排行榜文件*/}/*寫入文件操作函數(shù)*/void writefiles(struct person *tmp) {FILE * fpwrite。t open the file ! )。 } fwrite(tmp,sizeof(struct person),5,fpwrite)。} /*初始化記錄函數(shù)*/void initscorefiles() {int i。 for(i=0。i++) {a[i].score=0。 /*5人的名為nobody*/ } writefiles(a)。 for(i=0。i++) { if(=per[i].score) {if(i5) {for(j=4。j) per[j]=per[j1]。 break。 char string[10]。 /* 調(diào)用讀取文件中存在的記錄函數(shù) */ setfillstyle(1,9)。 /**/ outtextxy(490,230,highest board )。 rectangle(480,255,600,240)。 rectangle(481,226,601,241)。 bar(475,257,610,426)。 line(475,257,610,257)。 setcolor(8)。 line(610,257,610,426)。 outtextxy(480,265,name score)。i5。 outtextxy(480,290+i*30,per[i].name)。 /**/ setcolor(14)。 /*輸出分數(shù)*/ setcolor(8)。 setcolor(15)。 } getch()。 readfiles()。 bar(14,14,447,419)。 outtextxy(50,270,please enter your name:)。 printf( )。 scanf(%s,)。 parescore(curperson)。 /*調(diào)用寫入文件函數(shù),寫入排行榜記錄*/ } else outtextxy(70,250,your score is not enough on the board!)。 /*調(diào)用顯示排行榜函數(shù)*/} /*主函數(shù)*/void main(){ struct person curperson。 initgraph(amp。gm,c:\\TC3\\BGI)。 /*調(diào)用動畫音樂函數(shù)*/ setcolor(4)。 outtextxy(20,170, press enter key to continue...\n)。 /*輸出箭頭*/ setcolor(2)。 outtextxy(0,0,****************************)。 /*下面輸出*/ getchar()。 /*調(diào)用圖形系統(tǒng)初始化函數(shù)*/ drawk()。 /*玩游戲具體過程*/錯誤!未找到目錄項。 /*調(diào)用游戲結(jié)束處理函數(shù)*/ getch()。 /*關閉圖形系統(tǒng)*/} /*整個程序結(jié)束*/ 考 文 獻[1] 譚浩強,程序設計(第三版)【嗎】。【3】
點擊復制文檔內(nèi)容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1