引用 | 編輯
johnroyer
2005-05-26 17:33 |
樓主
▼ |
||
x0
小弟自己寫的賽馬遊戲目前沒有贏過 自己看看運氣如何吧 ^^~~~ 下載 註:用TurboC 3.0 IDE 編譯 若用其他編譯器請將函式往上提 程式碼: //------------------ Start ------------------------------------ #include <stdio.h> #include <stdlib.h> #include <conio.h> //------------------------------------------------------------- int h={0,0,0,0,0,0,0,0,0}; // the point of the horse int flag=0; /* stop when horse arrive flag=0 -> continue, flag=1 -> stop */ int chk; // the number of the horse which is win int way={1,1,1,1,1,1,1,1,1}; /* the way horses go way=1 -> right, way=-1 -> left */ int num; // save the random number int money=3000; // the money int pay; // the money that paid int bet; // horse number you bet char again='y' // run program again //------------------------------------------------------------- void main() { double w; randomize(); do { float k; int g; for( g=0;g<9;g++ ) { h=0; way=1; } chk=0; flag=0; pline(); betfont(); while( flag==0 ) { horse(); } gotoxy(35,19); printf("The winner is No.%d\n\n",chk); betpro(); gotoxy(30,24); if( again=='n' ) break; printf("Play again?(y/n) "); again=getchar(); }while( (again=getchar()) !='n' ); cr(); } //------------------------------------------------------------- int pline() { // There is "80" lines in DOS int i, line; clrscr(); for(line=1;line<19;line=line+2) { gotoxy(1,lin .. 訪客只能看到部份內容,免費 加入會員 x0
|
引用 | 編輯
johnroyer
2005-09-09 01:26 |
4樓
▲ ▼ |
下面是引用suntory於2005-06-18 11:56發表的 : 是嗎? 我覺得是運氣吧? 因為這我有試過了 一樣輸得很慘 ^^" x0 |
引用 | 編輯
terryshao
2005-10-05 01:29 |
5樓
▲ ▼ |
大大...我贏道破表了=.=
我前面一直輸....剩999...然後我贏兩場賺到8000 之後我押8000下去結果贏得-1543...... 哈哈哈 x0 |
引用 | 編輯
johnroyer
2005-10-13 18:19 |
6樓
▲ ▼ |
下面是引用terryshao於2005-10-5 01:29發表的 : 帥啊! 這個遊戲超不給我面子的 我從來沒贏過 你卻贏到破表…… 你可以把 money 的 type 改成 long 看看可以到多少 x0 |
引用 | 編輯
andrew412345
2010-02-06 02:13 |
7樓
▲ ▼ |
若用其他編譯器請將函式往上提
不懂其意思 ~"~ 我試過用 TurboC 3.0 .. 也會生錯誤 = = x0 |