These three videos cover the control loops – Repeat, While and For. These along with the previous variables & If statement videos cover the very fundamentals of programming.
- Concepts: Programming loops – three core types
- Skills: Apply fundamental programming constructs
Resources required: Computer workstation – it’s not strictly necessary to download these exercises to the micro:bit. The second video, WHILE, creates a mini-stopwatch which would be good to download.
Pre-requisites: The knowledge & skills from the first programming session.
The scripts are available for you to try out here:
The majority of other operations or functions in a programming language or environment are use-case specific. Doing statistics? Then the max, min, average functions are all about the solution. Programming a micro:bit – then getting the temperature, which way up it is, which button is pressed, are all about that device. But in the vast majority of mainstream languages, variables and control structures follow the same pattern. Ideally, students should recognise their continual use and become fluid at applying them.
This is a YouTube playlist of the three videos running to 15 minutes: