Think of it this way:
You have an upper limit and a lower limit on what the secret number could be. Originally these are 0 and 99. Each guess refines your lower and upper limit, depending on whether your guess is high, low or correct. If coded correctly, those two limits and the next guess...