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.
THEORY: the program uses sequence, selection, and repetition. Remember: sequence is just getting instructions in the right order.
It also uses > and < from maths. > means greater than; < means less than.
We can convert this program into Python, which is a much more powerful programming language.
It's pretty much one Scratch block equals one line of Python, although there are a couple of things we need to do a little bit differently in Python.
We'll divide the Scratch program into four parts to make it easier to handle.