Think of a number between 1 and 100, and I will
guess it in 7 turns or fewer.
(set: $tries to 0)
(set: $high to 100)
(set: $low to 1)
(set: $guess to 50)
[[Let's get started!->guess]]You said $guess is too high
(set: $high to $guess)
(set: $guess to ($high + $low) / 2)
(set: $guess to (floor: $guess))
[[Let me guess again->guess]]You said $guess is too low
(set: $low to $guess)
(set: $guess to ($high + $low) / 2)
(set: $guess to (floor: $guess))
[[Let me guess again->guess]](set: $tries to $tries + 1)
Turn $tries: I guess $guess
[[that's too high->high]]
[[that's too low->low]]
[[that's correct->correct]]I win! It took me $tries turns.
[[start over->begin]]