Thread: another game,Hmm.....(I can't get some more stimulation )

  1. #1
    Registered User angeljicu's Avatar
    Join Date
    Nov 2002
    Posts
    16

    Red face another game,Hmm.....(I can't get some more stimulation )


    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?
    there is angel,who love to see u.

  2. #2
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    why is it that i get these errors ?
    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

  3. #3
    Registered User angeljicu's Avatar
    Join Date
    Nov 2002
    Posts
    16

    Smile sorry,i forgot to tell you

    i use turboc2 to compile and run
    there is angel,who love to see u.

  4. #4
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356
    Code:
    #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;
    }
    This onw will work with ANSI compiler
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

  5. #5
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    so if im right theres no way of doing clrscr(); in ANSI ??

  6. #6
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by GanglyLamb
    so if im right theres no way of doing clrscr(); in ANSI ??
    No and No.

    And if your doing random numbers,read this on how to get better random numbers.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  7. #7
    Registered User angeljicu's Avatar
    Join Date
    Nov 2002
    Posts
    16

    Cool I think there couldbe more discuss on the random number

    I would write something about random number and its application.
    I think that's necessary.
    there is angel,who love to see u.

  8. #8

  9. #9
    Registered User angeljicu's Avatar
    Join Date
    Nov 2002
    Posts
    16
    ok thanx very much
    there is angel,who love to see u.

Popular pages Recent additions subscribe to a feed