Rullst AcademyRullst Academy/Lesson
Computational thinking: from idea to plan · Lesson 05 / 07

One recipe, several orders

The same plan must handle one order, three orders or none. Instead of copying instructions, we will repeat a block with a stopping rule.

Learning paths7 min

Let's discover together

  1. 1

    A repetition, also called a loop, runs a block more than once. Our block is: pack one kit → protect if it rains → deliver that kit.

  2. 2

    Repeating once per order connects the work to the input. With 3 orders the block runs 3 times and delivers 3 kits. Repeating only “deliver” would try to deliver something that was not packed.

  3. 3

    With zero orders, the block runs zero times. That is not an error: there is no work to do. The expected output is also zero deliveries.

  4. 4

    The rule needs to stop. “Repeat forever” does not meet the goal. A fixed count, such as repeating twice, also fails when the order count changes.

✦
YOUR MISSION

Count repetitions and deliveries, identify the repeated block and handle zero orders.

Now it's your turn

Discovery workshop

One recipe, several orders

Each repetition of the complete block handles exactly one order. Predict the result before checking.
Build your answers and check when you are ready.
A moment to understand

Which block should repeat once per order?

I need a hint

Look at the whole block and the order count. Zero is a valid input too.

Loading your journey…

Take it with you

Draw a border with a two-shape pattern repeated three times. Mark the block and repetition count. What would zero repetitions look like?

At your own pace

My files and GitHub

Every lesson can become your own record: code, notes or a practice plan. Saving a file to GitHub is optional and does not change your XP.

Student guide

The editor and downloads open when this lesson is available to your account. Check access below or return to the track map.

Checking your access to this lesson…

Rullstpetbot

AI can make mistakes. Check the lesson material.