Student workbook - Unit 4 Conditionals
Student workbook - Unit 4 Conditionals
Student workbook - Unit 4 Conditionals
Science
Unit 4:
Conditionals
Student workbook
makecode.microbit.org
Table of Contents
Overview......................................................................................................................................... 3
Unit summary............................................................................................................................... 3
Learning goals.............................................................................................................................. 3
Lesson A: Conditionals in daily life.................................................................................................. 4
Lesson B: Rock, paper, scissors...................................................................................................... 5
Lesson C: Code a board game........................................................................................................ 7
Glossary of key terms................................................................................................................... 14
Overview
Learning goals
During this unit, you will:
Understand what conditional statements are and why and when to use them in a program.
Learn how to use the Logic blocks ‘If…then’ and ‘If…then…else’.
Practice using the Logic blocks so different conditions yield specified outcomes.
Demonstrate understanding and apply skills by collaborating with classmates to create a
game that uses a micro:bit and a program that correctly and effectively uses conditionals.
You are all already familiar with the concept of conditionals in your daily life!
“If you clean your room, you can go out with your friends.”
“If your homework is done, you can play video games.”
“If you do your chores all week, you get your allowance, else you are grounded.”
These are all conditionals! Conditionals follow the format of IF this, THEN that.
The ELSE portion makes sure that a different action is performed in either case. Without the ELSE
action, you might be barefoot!
Coding
Working from the pseudocode specifications, work in pairs to try to code a Rock, paper, scissors
game on your own.
Introduction
Many board games use an electronic toy to signal moves or provide clues. There are some funny
examples online if you search for “electronic board game”. Here are some examples:
The micro:bit needs to work in conjunction with the game board and/or game pieces and should
be a central feature of the game. Ideally, it should be more than a simple substitute for a six-
sided die.
Ideally, you should be writing your own versions of micro:bit programs to do something original.
1. Battle pieces
Rules:
3. Up to four players.
micro:bit holder
Project expectations
Follow the design thinking approach and make sure your project meets these specifications:
5. Test your prototype solutions and refine until you come up with the final version.
Assessment
1 2 3 4
elements
Rules Most of the game More than one A game rule is All game rules are
rules are missing game rule is missing or not clear and
or it is not clear missing or not complete or not complete.
what the rules are complete or not clear.
clear.
Game board Game board Game board Game board Game board is:
meets only one of meets only two of meets only three
the conditions the conditions of the conditions
▪ Complete
listed for a score listed for a score listed for a score ▪ Neat
of 4. of 4. of 4.
▪ Fits with the
theme of the
game
▪ micro:bit is a
central part of
the game
micro:bit program micro:bit program micro:bit program micro:bit program micro:bit program:
lacks three or lacks two of the lacks one of the
more of the required elements. required elements.
▪ Uses the
micro:bit in a
required elements. way that is
integral to the
game
▪ Uses
conditionals
correctly
▪ Compiles and
runs as
intended
▪ Uses
meaningful
comments in
code
Explain how you decided, as a pair, on your particular board game idea.
What was something that was surprised you about the process of creating this game?
Describe a difficult point in the process of designing this game and explain how you
resolved it.
What feedback did your beta testers give you? How did that help you improve your game?
What were the Conditionals that you used as part of your game rules?
Publish your MakeCode program and include the link.
Assessment
1 2 3 4
elements
Diary entry Diary entry is Diary entry is Diary entry is Diary entry
missing three missing two of missing one of addresses all
or more of the the required the required elements,
required elements. elements. including:
elements.
▪ Brainstormin
g ideas
▪ Construction
▪ Programmin
g
▪ Beta testing