The Classic Guess my Number Game (in 2 dimensions)

  • This java applet will find your point on a two-dimensional graph in the least amount of guesses.
  • This is the same game that you used to play as a kid. IE, you pick a number between 1 and 100 and your friend tries to guess it. The algorithm is simple. It first searches for the x-coordinate, then the y. The way it works is, it starts in the middle x-coordinate, then determines if it's to the left of middle, or to the right of middle. If it's less, then it chooses the half way point between the current position and the original coordinate. It does this until it finds the x-coordinate that you chose. Then, it does the same thing with the y-coordinate. Once it finds the x and y coordinates, it draws a line from the middle to the point that was guessed by the user.
  • The interface consists of using the mouse and left clicking somewhere in the rectangular (white) region. When the computer guesses, it puts a red dot on the screen. On the upper left portion of the screen, you can see the number of guesses it took for the computer to find your point. The moment you click the left mouse button, the computer will find the answer. It works on the premise that, if the computer asked you "is your number greater or less than N", and you repond Yes, or No, the computer will continue to guess. But, instead of you having to tell the computer, the computer does it automatically without cheating.