title: Performing binary search to guess a random number, but the number of guesses not matching
body: <p>I have written a simple guessing game and a method to guess it... </p>
  
  <pre><code>    from gasp import *
  
      number = random_between(1, 1000)
      guesses = 0
  
      while True:
          guess = input("Guess the number between 1 and 1000: ")
          guesses += 1
          if guess &gt; number:
              print "Too high!"
          elif guess &lt; number:
              print "Too low!"
          else:
              print "\n\nCongratulations, you got it in %d guesses!\n\n" % guesses
              break
  </code></pre>
  
  <p>Now according to the question the max number of guesses should be equal to 11 if the proper strategy is used.I used binary search to get the right number, but the the number of guesses are never more than 10. To check I did the following and it produced a non terminating loop.</p>
  
  <pre><code>    from gasp import *
  
  
      guesses = 0
      big = 1000
      small = 1
      while guesses != 11
          number = random_between(1, 1000)
          while True:
              guess = (big + small) / 2
              guesses += 1
              if guess &gt; number:
                  print "Too high!"
                  big = guess
              elif guess &lt; number:
                  print "Too low!"
                  small = guess
              else:
                  print "\n\nCongratulations, you got it in %d guesses!\n\n" % guesses
                  break
  </code></pre>
  
  <p>So who is right am I making some mistake or the number of guesses required can't be more than 10 and the question is wrong.</p>