Logomation Lesson 2

Create and run this program:

// zig zag to the right

left 45

repeat 5

forward 30

right 90

forward 30

left 90

// go straight right

right 45

forward 100

Save the program as zig-zag.

Change the number after repeat to 7 and run it again. Change it to 3 and run it again.

The lines of code that are repeated are the lines that are indented. The lines at the end which are not indented are executed after all the repetitions.

Comments are indented to line up with the line that follows it—not the preceding line.


On your own #2:

Square and a Hexagon
draw a square and a regular hexagon (6 sides) using repeat loops—include 2 or 3 good comments


Proceed to Lesson 3

Go back to the Lesson List page