# A guessing game

• 04-02-2003
Lyanette
A guessing game
I have an assignment to write a number guessing game. That I think I can do, but there's a catch. The assignment reads..

With each good guess out of 10 the player should be able to eliminate half of the numbers. Show why any number from 1 to 1000 can be guessed in 10 or fewer tries.

Can someone explain?
• 04-02-2003
Stoned_Coder
do a websearch or a board search for "binary search".

All will be revealed to you. Think about it first. How could you do it. And you can in your head quite easily.
• 04-02-2003
zbap
what about if on the first error you give them an idea as to how much off they approximately are?
• 04-02-2003
Stoned_Coder
nope just a simple its this way and not that way
• 04-03-2003
Munkey01
Quote:

Originally posted by zbap
what about if on the first error you give them an idea as to how much off they approximately are?
Then they could simply add (or subtract) the number given to their number and find the answer.
• 04-03-2003
PJYelton
Hey lyanette, think of it this way. If I said pick a number between 1 and 1000, what number would YOU pick? Why would you pick that number? If I said that number was too low, what number would you pick next? Why did you pick that one? Keep going. That should answer your question.