I can guess a number between 1 & 100 within 7 tries! If I guess too low, say "higher" If I guess too high, say "lower" If I get it right, say "yes"
This deals with 2 kinds of variables in Scratch: number variables and answer variables. This uses the classic binary search algorithm. For more information: http://cs.umw.edu/~finlayson/class/fall12/cpsc110/notes/11-searching.html