A bug is sitting on a blue segment. Red segments are stamped across the blue segment to divide the blue segment into equal size pieces. Students sequence blocks for the red segment sprite. They experiment until they get one of the red segments to cross the red section of the bug’s body. Then they decide at which fractional part of the blue segment the bug is located. There is more than one way to divide the blue segment so that a red segment crosses the bug’s body. These occurrences are all equivalent fractions.


Programming Skills with Scratch:

  • Sequence blocks in order to accomplish a goal
  • Scratch blocks used: set __ to, stamp, repeat, move, and reset.


  1. Open the scratch activity Bug on a Line Scratch activity (teacher version).
  2. When it first opens, the bug is not sitting on the blue segment. Explain that by clicking the green flag, the bug moves to the segment. Move the bug around the screen. Click the green flag. Ask students to notice that whenever the green flag is click, the bug will return to the same spot on the segment.
  3. Tell students they will create a code by arranging blocks for the red segment sprite to stamp equal sized red segments across the blue segment. The challenge is that they need to find a way to make the red segments cross the bug on the red part of its body. Press the space bar and the right arrow to show examples of this.
  4. Tell students they should be careful. They must make sure the red segment crosses exactly on the red part of the bug’s body. Press the up arrow and the down arrow to show examples of red segment crossing the bug, but not on the red part of its body.
  5. After they find a way to make the red segment cross the bug’s body, they should decide on which fraction of the blue segment the bug is located. Press the left arrow to discuss this. The bug will move to 2/3 of the line. Review how kids can tell this 2/3. (The line is cut into 3 equal pieces and the bug is on the second line.)
  6. Open Bug on a Line Scratch activity (student version). Explain that this script does not work. Look at the scripts for the red segment. They are not connected, and there is not an input in the repeat or set pieces to __ blocks. Students use the guess and check method to sequence the blocks correctly and find a number that works as input for the blocks.
  7. Decide if you want students to work alone or with partners.
  8. After students have the student link open, pass out the Recording Results.
  9. Students remix and same the activity.
  10. Allow time for students to share their projects.


  • Ask students to write a list of all the fractions they found that worked. Then ask them to write about any patterns they see in the list. (Possible answers include: All denominators are multiples of 4. All are equivalent fractions.)


  • If students are having difficulties finding the correct input number, suggest they use the same number in both the repeat and set pieces to blocks.
  • If students are finding it difficult to find the correct sequence, suggest which blocks to include in the repeat block. Or arrange the sequence for them and ask them to guess on the input numbers.
  • Common Core:

    4.OA.3, 4.NBT.3, 4,NBT.4, 4.NBT.5, 4.NF.1, 4.NF.3, 4.NF.5, 4.NF.6, 4.MD.2, 4.MD.4, 4.MD.5 5.G.1, 4.G.3

    CT/CS Standards:

    CT– Decomposition, Pattern recognition, Algorithm design, Pattern generalization & abstraction
    CS– Understand that algorithms are implemented as programs on digital devices, Understand that programs execute by following precise and unambiguous instructions, Write programs that accomplish specific goals, Use sequence in programs, Design and create content

Champaign Unit 4 School DistrictKenwood Elementary School: bright stars, bright futures
College of Education at IllinoisUChicago STEM EducationNSF
These lessons were written by Judy Rocke based on lessons developed at Kenwood Elementary School in the Champaign Unit 4 school district. Funding was provided by the National Science Foundation under award number 1542828. These lessons are intended to be used alongside the EM-4 curriculum.

Lessons prepared as web documents in Summer 2017. Contact us for updated lesson plan materials.