Module · Detail

Love letter with loop backwards to place

This module introduces the application of nested loops and strengthens understanding for structured repetition processes. Algorithmic planning of movement sequences supports systematic competency development in handling iterations.

Time 5 minutes
Format rpgDungeon
Language Python 2 (CE)
Tasks 1
Preview image: Love letter with loop backwards to place

Introduction (Original excerpt)

Leo Loop has a very special mission again: He must bring Kaya's secret love letter to Jayden. However, Jayden is somewhere in the stone labyrinth - well hidden and hard to reach. Luckily, Leo can handle loops!

Didactic classification

Subjective objective

In the center of this lesson module is the introduction and application of nested for-loops in a problem-oriented environment. Students model a movement sequence where a decreasing step count must be iteratively implemented. The task requires transferring an abstract number pattern into concrete control commands within a spatial problem statement. The connection between algorithmic modeling (decreasing iteration) and implementation (movement sequence) becomes immediately tangible. Thus, basic understanding of controlled repetition processes in the context of program flows is established.

Competence development

Didactic added value in the lesson

Flow of the lesson unit

1

Find Jayden in the labyrinth

In this step, navigation is implemented using a structured environment with nested loops. The number of movement steps decreases in each iteration, requiring systematic adjustment of the program flow.

  • Didactic focus: Nesting of loops
  • Typical challenge: Representing a descending numerical pattern in movement logic

Task (excerpt)

  1. Navigating the labyrinth using a nested loop.
  2. Using a decreasing step count for movement sequences.
  3. Turning right after each movement segment.

Example (excerpt)

The following fragment illustrates the structuring of a movement sequence through an outer and inner loop:

1
2
3
4
for schritt_laenge in range(10, 0, -1):
    for schritt in range(schritt_laenge, 0, -1):
        bewegen()
    rechts_drehen()

Hints for classroom practice

This module connects nested iteration structures with a step-by-step implementation of algorithmic movement sequences in a modeled environment.

The clear task structure supports lesson organization and enables targeted result verification; differentiation can be achieved through further loop variations.

Request a demo access and test the module in your own course context.