Scenario 7 - Functions

Operational Goals

  • Understanding the technique of functions and the ability to define and use them in code

Introduction to the Topic

Functions allow for the reuse of a sequence of the same commands, in different places in the code. If there are sets of commands that you often use, you can save them as additional functions and call them in the code when you need them.

Task

Command: Arrange the code from blocks, set the appropriate step values, and lead Kodi to the finish. Remember to apply the additional function F1.

Course I, Functions - Level 0 - Introduction of a function without a parameter

Course I, Functions - Level 0 - Board solution

Task

Command: Arrange the code from blocks, set the appropriate step values, and lead Kodi to the finish. During the game, collect all the gold coins, open the mysterious chests with keys, and extinguish the fire blocking the passage. Remember to apply directional actions and additional functions F1 and F2.

Course II, Functions - Level 7 - Exercises in the use of more than one function

Course II, Functions - Level 7 - Board solution