Hello Forum,(adsbygoogle = window.adsbygoogle || []).push({});

I just learned about the "guess the number" game. There are 100 numbers, from 1 to 100 and the computer must ask questions to find the correct number.

The computer could start from 1 and go up until it finds the right number. That would involve a certain number of questions.

Or the computer could ask more intelligent questions, like "is the number smaller or larger than 50", etc....

Most of the codes I have seen don't ask that "is the number smaller or larger than 50?" but simply ask some binary questions that are all similar (is this number smaller or larger than the previously guessed number? etc....)

Why?

thanks

fisico30

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Guessing the number game

**Physics Forums | Science Articles, Homework Help, Discussion**