← Pandi & Pengu TV🎮 Play Robot Yolu

🤖 Algorithms: Step-by-Step Instructions

Episode transcript

Hello! Today we will learn about the algorithm. An algorithm is a list of instructions written step by step.

We use an algorithm every day! When you brush your teeth: first put toothpaste on the brush, then brush, then rinse, then put the brush away. The steps happen in order.

Order is very important! We put on the sock first, then the shoe. If we change the order, the algorithm does not work.

A robot does not think. It only does what we tell it. We told the robot forward, forward, turn right, forward, forward. The robot reached the star!

In the game, the instructions are arrow cards: right, left, up, down. Pengu follows the cards in order, starting from the first card: right, right, up. He reached the star!

Oh no! Pengu did not reach the star. There is a bug in the program. The second card says up, but the path goes straight along.

We found the bug: we changed the second card to right. Now Pengu reaches the star! Finding a bug and fixing it is called debugging.

To go right three times, we could write three cards. But there is a shorter way: right 3 times. This is called a repeat block. Pengu moves three squares to the right.

To sum up: an algorithm is steps in order. A robot only does what it is told. If there is a bug, we find it and fix it. A repeat block makes the job shorter. Now try it in the game!