☰ Contents · Computing

A sequence of actions and the algorithm

Lessons 17–19 · 3 lessons · F.M. Zakirova, M.R. Zakirova. Informatics and Information Technology Grade 2. Novda Edutainment, 2024
19

Making an algorithm

Textbook: pp. 48–50
GoalWrite an algorithm for a robot with arrows and carry it out on a grid.
New words
square · katakto move · siljimoqleft · chapgaright · o‘ngga
Explanation

Commands can be given in words or with signs. We steer a robot on a grid with arrows: ← left, → right, ↑ up, ↓ down. Each arrow is one square. To make an algorithm short we write a number next to the arrow: “→ 3” means 3 squares to the right.

Worked examples
The robot is in the bottom left square. After → → ↑ ↑ it is 2 squares right and 2 squares up.
→ → → → written short is → 4.
Class activity

“Robot child”: draw a 5×5 grid on the floor. One child is the robot; the class builds an algorithm with arrow cards to take it to the square with the “gift”. The robot does exactly what the command says!

Practice
1
A robot followed ↑ → → ↓ ↓. Where is it now compared with its start square?
2
Write “→ 4” and “↑ 3” in full with arrows. How many arrows are there in all?
3
A robot draws a square with sides of 2: → → ↑ ↑ ← ← ↓ ↓. How many arrows are there?