賽馬遊戲

Home Home
引用 | 編輯 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
引用 | 編輯 spws
2005-05-27 18:16
1樓
  
我也是沒有贏過
但大大在TurboC 的環境寫到這個小遊戲 的確很厲害唷
如果小馬的移動速度能夠慢一點就比較好

獻花 x0
引用 | 編輯 suntory
2005-06-18 11:56
2樓
  
小弟無聊下載來玩
倒是 贏了不少喔 ㄏㄏ
有一點BUG 一直押8号 中奬機會大喔

獻花 x0
引用 | 編輯 codeboy
2005-06-23 09:38
3樓
  
幫你把編譯好的程式放到版上以免遺失.. 表情

本帖包含附件
檔名: zip game.rar   (2022-06-09 14:01 / 23 KB)   下載次數:156


獻花 x0
引用 | 編輯 johnroyer
2005-09-09 01:26
4樓
  
下面是引用suntory於2005-06-18 11:56發表的 :
小弟無聊下載來玩
倒是 贏了不少喔 ㄏㄏ
有一點BUG 一直押8号 中奬機會大喔

是嗎?
我覺得是運氣吧?
因為這我有試過了
一樣輸得很慘   ^^"

獻花 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發表的 :
大大...我贏道破表了=.=
我前面一直輸....剩999...然後我贏兩場賺到8000
之後我押8000下去結果贏得-1543......
哈哈哈

帥啊!
這個遊戲超不給我面子的
我從來沒贏過
你卻贏到破表……

你可以把 money 的 type 改成 long
看看可以到多少   表情

獻花 x0
引用 | 編輯 andrew412345
2010-02-06 02:13
7樓
  
若用其他編譯器請將函式往上提
不懂其意思 ~"~

我試過用 TurboC 3.0 .. 也會生錯誤 = =

獻花 x0
引用 | 編輯 k7138
2011-03-25 06:44
8樓
  
跟電腦玩真是要有很強的心臟

獻花 x0
引用 | 編輯 csr
2011-05-27 21:51
9樓
  
dev c++無法編譯
不知有那位大大
肯將它修改
謝謝

獻花 x0