← Back to Autumn 2025 Overview
Week 3 — Conditionals (if/else)
Focus Concept: Logic & Decision-Making
Mini-Project: Rock–Paper–Scissors
Objectives
- Understand how conditionals (if/else) allow programs to make decisions.
- Use
if … elseto create different outcomes in code. - Build a Rock–Paper–Scissors program where the micro:bit chooses at random.
Success Criteria
- I can explain what a conditional is.
- I can build a program that uses if/else to show different outputs based on a random choice.
- I can play Rock–Paper–Scissors fairly using my micro:bit.
Key Vocabulary
- Input — something the micro:bit senses (e.g., button, accelerometer, light sensor, etc.)
- Output — what the micro:bit does in response (LEDs, sound, text).
- Event — something that happens (like pressing a button or shaking the device) that starts code.
- Conditional (if/else) — a rule in code that checks something and chooses what to do.
- Logic — the set of rules a computer follows to decide what to do. In coding we use conditionals (logic blocks like if…then…else) to check conditions and choose between actions. Logic can also use connectors such as AND, OR, and NOT to combine conditions.
- Variable — a named “box” in memory that stores information your program can use or change (e.g. storing a dice roll or a random choice).
- Random — an unpredictable number chosen by the computer.
- Fairness — when all outcomes have the same chance (important in games of chance).
Resources
- MakeCode Editor: makecode.microbit.org
- Logic in Makecode: makecode.microbit.org
- PRIMM recap — Simple Coin Flipper: open project
- Rock–Paper–Scissors (MakeCode guide): project page
- Math Antics - Basic Probability: video
- What is random?: Reference
Equipment
- BBC micro:bits + USB cables (1 per child or pair)
- Chromebooks with internet access
Safety & Setup Notes
- Handle devices gently when using shake or button events.
- Share devices and take turns fairly.