Activity: Dash the Snake

  1. Project your tablet screen, open the Blockly app, and go to the menu at the top left of the screen.
  2. Go to the Create New Project menu and select the Dash the Snake preset program. Then tap “create.”Dash the Snake
  3. Ask the students to look at the program and predict what they think will happen when it is run.
  4. Run the program and point to the top left of the screen. Have students pay attention to how each variable changes value. Encourage them to make observations:
    • When the orange variable increases in value, the banana variable decreases in value.
    • The watermelon and cherry variables are either 10 or 0 and nothing in between.
    • Dash turns left and right, in a snake pattern!
  5. Scroll down to the bottom of the code and point at the Do Variable block. Say, “This block is setting Dash’s wheel speeds to 2 variable values: orange and banana. That’s how Dash moves forward left and right like a snake.”
  6. Tap the Do Variable block and say, “Let’s see what else we can do with this block!” Then tap “Turn” and change the block to read “Turn Orange degrees.” Ask the class, “What do you think will happen when we run the program now?
    • Sample response: “Dash keeps turning to the right.”
  7. Ask, “What behaviors could Dash do other than spin?” Then have student volunteers try changing the Do Variableblock and the variable values.

Complete and Continue