Puzzle 1 – guessing a number

The Algorithm

Here's my Scratch program showing a way of coding a binary search algorithm. It's not too tricky. See if you can figure out how it works.

Scratch program image

We can convert this program into Python, which is a much more powerful programming language.

It's pretty much 1 line of Python to a single Scratch block, although there are a couple of things we need to do a little bit differently in Python.

We'll divide the Scratch program into 4 blocks to make it easier to handle.