Welcome to Year 6 Computing — Micro:bit Lesson 4: Conditionals & Logic Games! 🎮🤖
You have mastered events and variables. Today, we give our micro:bit a “brain” by teaching it how to make decisions using Conditionals (If/Then logic) to build a working Rock, Paper, Scissors game!
Target Standards:
- CSTA 1B-AP-10: Create programs that include sequences, events, loops, and conditionals.
- ISTE 1.5.c: Break problems into component parts and extract key information.
- UK NC: Use logical reasoning to explain how some simple algorithms work and to detect and correct errors (debugging).
Step 1: Keyboard Warm-up ⌨️ (10 Mins)
- Click here to warm up your fingers: Start Typing Practice on Ndovu.
- Today’s keywords: conditional, logic, random, decision, variable, hardware.
Step 2: What is a Conditional? 🎬 (5 Mins)
A Conditional is a rule that tells the computer to make a decision based on a specific condition. We usually call these If/Then statements.
Example: IF it is raining outside, THEN take an umbrella. ELSE, wear sunglasses!
Step 3: Generating Random Data 🛠️ (10 Mins)
Let’s create the random numbers for our game. Log into your teacher’s Micro:bit Classroom.
- Go to the red Variables menu and make a new variable called hand.
- Get an on shake event block from the pink Input menu.
- Inside the shake block, put a set hand to 0 variable block.
- Go to the purple Math menu, find the pick random 0 to 10 block, and drag it exactly over the “0” in your variable block.
- Change the numbers so it reads: pick random 1 to 3. Now, every time you shake it, the computer secretly picks 1, 2, or 3!
Step 4: The Rock, Paper, Scissors Challenge 🧩 (25 Mins)
Mission: Program the Game Logic!
The micro:bit has picked a random number, but you cannot see it yet! You need to use Logic blocks to turn that secret number into an LED picture on the screen. Can you figure out how to snap these blocks together?
- The Goal: 1 = Rock icon, 2 = Paper icon, 3 = Scissors icon.
- Clue 1: Go to the teal Logic menu and find the if / then / else block. Put it right under your variable block inside the shake event.
- Clue 2: Click the small [+] icon at the bottom of the Logic block to add an “else if” section.
- Clue 3: You will need a Comparison block (it looks like
0 = 0in the Logic menu) to check if your hand variable equals 1, 2, or 3. - Bonus: Download your `.hex` file to your real micro:bit and challenge a partner to a game!
Step 5: End of Unit Assessment 👋 (10 Mins)
Congratulations on completing the Micro:bit unit! Fill out this final assessment to prove your mastery of hardware, software, and coding. Click download to save your official End of Unit Certificate!

Comments are closed, but trackbacks and pingbacks are open.