:cool:
It's a game for you to bet,I think there are some more stimulateion which could be added into it.
That is I often have some ideas,I add to my program,
I need you all,give me some suggestion?
Printable View
:cool:
It's a game for you to bet,I think there are some more stimulateion which could be added into it.
That is I often have some ideas,I add to my program,
I need you all,give me some suggestion?
why is it that i get these errors:confused: ?
C:\WINDOWS\TEMP\ccNJ8dgb.o(.text+0x127):roller.c: undefined reference to `clrscr'
C:\WINDOWS\TEMP\ccNJ8dgb.o(.text+0x12c):roller.c: undefined reference to `randomize'
C:\WINDOWS\TEMP\ccNJ8dgb.o(.text+0x136):roller.c: undefined reference to `random'
i have had these errors be4 when i tried to use clrscr();
im using dev-c++ version 4.01
grtz
Lamb
i use turboc2 to compile and run:)
This onw will work with ANSI compilerCode:#include<time.h>
#include<stdlib.h>
#include<stdio.h>
int main()
{
int roll,choice,ante,mark=100;
srand(time(NULL));
do{
roll= 1 + rand() % 6;
while(1)
{
printf("\nNow you have 100 marks!");
printf("\ninput ante(5<=ante<=%d):",mark-5);
scanf("%d",&ante);
if(ante>=5&&ante<=mark-5)break;
else if(ante<5){printf("\nYour ante too small!");continue;}
else if(ante>mark-5){printf("\n Your ante overrun the max ante!");continue;}
}
printf("Buy big/small\n");
printf("1.big\n");
printf("2.small\n");
printf("3.quit\n");
printf("choose:");
scanf("%d",&choice);
switch(choice)
{
case 1:if(roll>9)
{
printf("Hmm...You Won!\n");
mark+=ante;
}
else
{
printf("Oh,sorry,you lost!\n");
mark-=ante;
if(mark==5){printf("I'm sorry,you'd better not go on!");getch();exit(1);}
}
break;
case 2:if(roll<=9)
{
printf("Hmm...You Won!\n");
mark+=ante;
}
else
{
printf("Oh,sorry,you lost!\n");
mark-=ante;
if(mark==5){printf("I'm sorry,you'd better not go on!");getch();exit(1);}
}
break;
case 3:break;
}
printf("roll:%d",roll);
printf("\tmark:%d",mark);
}while(choice!=3);
return 0;
}
so if im right theres no way of doing clrscr(); in ANSI ??
I would write something about random number and its application.
I think that's necessary.;)
Click here for more information about rand() and it not being so random
Hope this helps!:D
ok thanx very much