Thread: Hi-Lo Game

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    10

    Hi-Lo Game

    Does anyone know where I can find a guide or reference on a Hi-Lo game? The game is to produce a random integer between 1 and 100 and provide the user with seven tries to guess the generated number. if the user guesses the correct number a message should appear that congratulates them. If the user guesses the wrong number, the message "try again" should appear and indicate whether the guess was too high or too low and also display the number of guesses left. After seven incorrect guesses, the computer should display the message, "sorry, you lost." and display the correct number.

    I know there is a source out there, but all I could find was sources in other programming languages.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    What you've described is a binary search. Very easy to code one up - give it a try.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by kpop View Post
    Does anyone know where I can find a guide or reference on a Hi-Lo game? The game is to produce a random integer between 1 and 100 and provide the user with seven tries to guess the generated number. if the user guesses the correct number a message should appear that congratulates them. If the user guesses the wrong number, the message "try again" should appear and indicate whether the guess was too high or too low and also display the number of guesses left. After seven incorrect guesses, the computer should display the message, "sorry, you lost." and display the correct number.

    I know there is a source out there, but all I could find was sources in other programming languages.
    This can be done in about 15 lines... less than an hour with a coffee break at half time...
    I'm guessing you've already wasted more than that ripping up the web looking for some scoop and poop code.

    Really... if you want to be a programmer, learn to program... not to steal.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. Replies: 15
    Last Post: 10-20-2009, 09:39 AM
  3. Open Source / Semi Open source game idea. Help needed
    By CaptainPatent in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 05-16-2007, 10:44 AM
  4. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM

Tags for this Thread