引用 | 编辑
johnroyer
2005-05-26 17:33 |
楼主
▼ |
||
![]() 目前没有赢过 自己看看运气如何吧 ^^~~~ 下载 注:用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 .. 访客只能看到部份内容,免费 加入会员 ![]()
|
引用 | 编辑
johnroyer
2005-09-09 01:26 |
4楼
▲ ▼ |
下面是引用suntory于2005-06-18 11:56发表的 : 是吗? 我觉得是运气吧? 因为这我有试过了 一样输得很惨 ^^" ![]() |
引用 | 编辑
terryshao
2005-10-05 01:29 |
5楼
▲ ▼ |
大大...我赢道破表了=.=
我前面一直输....剩999...然后我赢两场赚到8000 之后我押8000下去结果赢得-1543...... 哈哈哈 ![]() |
引用 | 编辑
johnroyer
2005-10-13 18:19 |
6楼
▲ ▼ |
下面是引用terryshao于2005-10-5 01:29发表的 : 帅啊! 这个游戏超不给我面子的 我从来没赢过 你却赢到破表…… 你可以把 money 的 type 改成 long 看看可以到多少 ![]() ![]() |
引用 | 编辑
andrew412345
2010-02-06 02:13 |
7楼
▲ ▼ |
若用其他编译器请将函式往上提
不懂其意思 ~"~ 我试过用 TurboC 3.0 .. 也会生错误 = = ![]() |