Skip to content

More Reeborg! MORE REEBORG!

Reeborg waving. Reeborg waving, smaller. Reeborg waving, smaller still. Reeborg waving, even smaller.

Overview

You'll learn to repeat instructions with loops and combine them with your own functions — first to tighten up an old solution, then to send Reeborg over a row of hurdles.

Builds on

Even More Reeborg!. Keep your saved programs from that lab.

Before you start

Each mission below has its own button that loads the right world. Save your work after every world — you'll turn all of them in at the end. The world names (such as Step 4) are Reeborg's labels; the numbered instructions below are this lab's action steps.

You've got it when…

  • Your Step 8 solution uses at least two loops and still completes the mission.
  • Your jump_hurdle() function clears one hurdle, and a loop calls it to clear them all.
  • You've saved a .py file for both steps.
  • You've saved library.py if your program imports it.

Collaboration & AI

Work: On your own. You can compare notes with a neighbor, but write your own commands.

AI — AIAS Level 1, No AI: Write and debug your own code without AI assistance. What the levels mean.


Step 9 — Loops

  1. Work through this world, then save your program.

    Open Step 9

    Sometimes we need to repeat instructions several times. Instead of writing out each repeated instruction like this:

    move()
    move()
    move()
    move()
    move()
    move()
    move()
    move()
    

    …we can instead use a loop, like this. repeat is a Reeborg extension, not standard Python:

    repeat 8:
        move()
    

    Your mission: update your solution from Step 8 to use at least two loops. You can use loops in your Python code and also in your library!

Step 10 — Hurdles

  1. Work through this world, then save your program.

    Open Step 10

    Your mission:

    • Create a new function named jump_hurdle() that jumps a single hurdle. Here's some code to get started.

      def jump_hurdle():
          # Replace pass with the commands to jump one hurdle.
          pass
      
    • Use a loop to call your jump_hurdle() function repeatedly to jump all the hurdles.

Check Your Work

  1. Run Step 9 with different flower positions and check that it uses at least two loops. Run Step 10 and check that a loop calls jump_hurdle(). Save Step 9.py, Step 10.py, and library.py if either program imports it.

Turn It In

  1. Submit these Python source files:
  • Step 9.py
  • Step 10.py
  • library.py, if imported by your program

Include your library

Save the contents of the library tab separately from Python Code. When reopening your work in Reeborg, restore that code to the library tab before running a program that imports it.


How It's Graded

One score, from 0–4, covers your submitted Python source files.

Score Evidence
4 Excellent Both programs and any imported library are submitted. Step 9 uses at least two loops and completes the flower mission; Step 10 uses a loop to call jump_hurdle() and clears every hurdle.
3 Above Average All required programs work and use the required constructs, with minor errors or omissions in code organization.
2 Average Some required work functions, but a mission, required construct, or source file is missing.
1 Below Average Programs are largely incomplete or nonfunctional.
0 Failing No submission or no evidence of the required work.

Credit: Adapted from Dan Schellenberg's Computer Science 20 textbook.