Conditional statements

Board game example

This unit introduces the Logic blocks, such as ‘If…then’ and ‘If…then…else’. You will learn what conditional statements are, and why and when to use them in a program, practicing skills of creativity, problem solving, and collaboration in the process. You will code a game of “Rock, paper, scissors” with the micro:bit via the programmable buttons and the LED screen. In the final project, you’ll be designing, building, and coding your own unique micro:bit-based board game using conditionals.

Lesson objectives

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 skill by creating a game that uses a micro:bit and a program that correctly and effectively uses conditionals.

Lesson plan

  1. Overview: Conditional statements
  2. Activity: Rock, paper, scissors
  3. Project: Board game

Targeted CSTA standards