Plug In

- Conditional instruction, condition -

Introduction

After the Drakonid invasion, it turned out that some connections were broken. The Coders moved to different places, so now they need to be restored to their proper places. For energy to flow between the Coders, they must line up with the plugs. This is a necessary condition to be met - that's how they were programmed. The Coders received specific instructions on how to position themselves to effectively transfer energy. Their internal program was based on the condition: if you line up with the plugs, then energy will flow. Help the lost Coders and set them at the height of the plugs by lighting the appropriate number of LEDs for each Coder by stomping on the LED. Thanks to your help, the condition will be met, and energy will flow again between the inhabitants of the planet.

Application Instructions

After the Drakonid invasion, it turned out that some connections were broken. Set the Coders at the height of the plugs by lighting the appropriate number of LEDs for each Coder by stomping on the LED. This will allow energy to flow again between the inhabitants of the planet.

Conversation Inspirations with Children

Talk to students about known life situations or examples from their immediate environment in which they use or may encounter the concept mentioned:

  • What conditions must be met beforehand for something we plan to happen? Let's think:
  • If you want to have vegetables in the garden, you must sow the seeds.
  • If you want to cook dinner, you must buy all the products.
  • If you want to have clean clothes, you must do the laundry.
  • If you want to fly abroad, you must buy airline tickets.
  • Ask students what other examples they know?

What is a conditional instruction?

It is an element of the programming language that allows for the execution of different instructions depending on whether the logical expression defined by the programmer is true or false. Deciding what step will be taken next is one of the basic features of modern computers.