Math Bonk! Learning Centre Play the game

Worksheet for the lesson Coding with Repeats · All worksheets

Coding with Repeats

Grade 2 math worksheet · mathbonk.com/learn

Name: ______________________   Date: ____________

Look

A grid of stamps that is 3 rows tall and 6 columns wide, with arrows showing an outer loop and an inner loopinner loop: 6 timesouter loop: 3 times
  1. The outer loop runs 3 times and the inner loop runs 6 times. How many stamps in all?
  2. How many stamps are in each row?
  3. Write the code for the grid using two repeat blocks.

Practice

  1. Write "jump, jump, jump, jump" with a loop
  2. What does repeat 3 [clap, stomp] do?
  3. How many steps forward is repeat 5 [forward 2]?
  4. How many times do you turn in repeat 4 [forward 1, turn right]?
  5. What shape does repeat 4 [forward 3, turn right] trace?
  6. Shorten: forward, forward, turn left, forward, forward, turn left
  7. A robot faces north and turns right. Which way does it face now?
  8. A robot faces north and turns left twice. Which way does it face now?
  9. A toy needs to go forward 6 squares. Write it with a loop
  10. Code: repeat 3 [forward 2]. The toy started on square 0. Which square does it end on?

Think it through

  1. Draw the path a robot traces with repeat 3 [forward 4, turn right].
  2. Explain why repeat 5 [forward 2] moves the same distance as repeat 2 [forward 5].

Challenge

  1. How many steps are in repeat 3 [repeat 2 [forward 1, turn right]]?
  2. A bug moves with repeat 4 [forward 3, turn left]. Where is it compared with its starting square?

Answer key

Look

  1. 18
  2. 6
  3. repeat 3 [repeat 6 [stamp]]

Practice

  1. repeat 4 [jump]
  2. clap, stomp, clap, stomp, clap, stomp
  3. 10
  4. 4
  5. a square
  6. repeat 2 [forward, forward, turn left]
  7. east
  8. south
  9. repeat 6 [forward]
  10. 6

Think it through

  1. Three sides of a square, each 4 squares long
  2. Both move 10 squares: 5 × 2 is the same as 2 × 5

Challenge

  1. 12
  2. Back at the start, because it walked around a square