View Single Post
Old 08-12-2006, 05:25 AM   #4
LSDDSL

Join Date
Oct 2005
Posts
619
Senior Member
Default
pseudo code that may work...

Code:
Code
int number = 1+rand()%20; boolean done = false; int tries = 5; int guess;  while(!done && tries >0){     printf("Please Guess the Number between 1 and 20, You have %d tries remaining.\n", tries);     scanf("%d", &guess);     tries--;     if(guess==number){         printf(blah);         done = true;     }  }

You may want to put something in so that if a user enters something outside the range it doesn't count as one of their tries.

I feel like I've given too much away possibly!
eh ive never learned any boolean commands yet so i think he would think i was cheating

weve basically learned functions, random numbers, for and while loops and other random crap

BUT! some of the code helped me get it right! thanks alot man!
LSDDSL is offline


 

All times are GMT +1. The time now is 07:50 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Design & Developed by Amodity.com
Copyright© Amodity