انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents
Robo Block: home
0. Lab tour1
1. Getting started5
2. Motion5
3. Looks and sound5
4. Events4
5. Loops5
6. Conditions and sensing4
7. Variables and randomness4
8. Project: the “Catch Robo” game3
9. Messages: characters talk to each other4
10. Clones: one character, many copies4
11. My Blocks: make a new block3
12. Operators and time4
13. The pro project: a jumping game4

The pen: draw where you walk

Section 5: LoopsLesson 5.2 · ⏱ 7 min

The pen blocks make the character draw a line as it moves. Put the pen down before moving, and lift it when you want to move without drawing.

Blocks: when 🚩 clicked, erase all, set pen color to (red), pen down, repeat (4), pen up
🖥️ What happens on the stage?
Robo clears the stage, then draws a red square.
The stage after running the program in Robo Block
💡 Tip
To draw any regular shape: the number of sides goes in repeat, and the angle = 360 ÷ the number of sides.

📌 Another example: a purple pentagon

Five sides, and the angle is 72 (360 ÷ 5). pen size 4 makes the line thicker.

Blocks: when 🚩 clicked, erase all, go to x: (-60) y: (-80), point in direction (90), set pen color to (purple), set pen size to (4), pen down, repeat (5), pen up
The pentagon
The pentagon
✍️ Practise
Draw a circle: repeat 36 times move 10 and turn 10. Then try 72 times with turn 5.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

Draw a straight line 300 long from left to right.

👀 Show the solution
Blocks: when 🚩 clicked, erase all, go to x: (-150) y: (0), point in direction (90), pen down, move (300) steps, pen up
The result on the stage
The result on the stage
Medium

Draw a red triangle.

👀 Show the solution
Blocks: when 🚩 clicked, erase all, go to x: (-50) y: (-50), point in direction (90), set pen color to (red), pen down, repeat (3), pen up
The result on the stage
The result on the stage
Hard

Draw two squares side by side: the first red and the second blue. (Lift the pen before you move across.)

👀 Show the solution
Blocks: when 🚩 clicked, erase all, point in direction (90), go to x: (-170) y: (-50), set pen color to (red), pen down, repeat (4), pen up, go to x: (30) y: (-50), set pen color to (blue), pen down, repeat (4), pen up
Two squares in two colours
Two squares in two colours
Finished the lesson? Mark it so your progress counts.