TECHNOLOGEPH

A Computer Science Curriculum for Kids




Lesson 2: Loops




Unplugged Activities

  1. Dice Dancing: Have students do a dance move repeated by the number the die lands on

Plugged Activities

  1. Simple Lego Example: Build a lego robot and write a program using a loop to have the robot drive in a square returning to its original position and orientation.

    No robot? Do the same thing in scratch, replacing the robot with a sprite.

  2. Lego Robot Maze: Build a lego robot and attach either an ultrasonic or force sensor to it. Set up a simple 3-4 turn maze and write a program including loops to have the robot navigate it. This will require the use of conditionals with the sensor so that the robot doesn't drive into a wall.

  3. Vowels: Using a pre-written isVowel() function and a loop, print each vowel in a word.

    def isVowel(char):

     if (char in “aeiou”):

      return True

     else:

      return False

    isVowel() takes a character (i.e. a single letter) as an argument and returns True if it is a vowel and false otherwise