TECHNOLOGEPH

A Computer Science Curriculum for Kids




Lesson 1: Conditionals




Unplugged Activities

  1. Cards: One student picks a card and depending on the suite and the number everyone does a certain action i.e. if its a 6 and heart jumps up and down three times. This can be made into a game by eliminating the student who does the wrong action or takes the longest to complete the right action.

  2. Simon says: Play a game of Simon Says. After a couple of rounds debrief. Talk about how Simon Says demonstrates how conditionals work. How does what Simon Says determine what you do? Break it down into an if statement.

    If Simon Says “Simon says” before the instruction:

     do the instruction

    else:

     do nothing

Plugged Activities

  1. Lego Example: Build a lego robot of choice (Mindstorms or spike). Once the robot is built, set it up about 10 feet away from the wall. Write a program that, using the sensor and conditionals, makes the robot move forward until it is near the wall, then stop.

  2. Simple Python Example: Using the randint() method in python, generate a random number. If that number is even have it print “this is an even number” is its odd print “this is an odd number”

  3. Harder Lego Example: Using a lego robot with the color sensor attached, have the robot follow a black line (requires knowledge of a while true loop). For a harder challenge use different colors to have the robot perform different actions such as a sharper turn.