Guessing game using a binary search algorithm