You may also like

problem icon

First Forward Into Logo 1: Square Five

A Short introduction to using Logo. This is the first in a twelve part series.

problem icon

LOGO Challenge 1 - Star Square

Can you use LOGO to create this star pattern made from squares. Only basic LOGO knowledge needed.

problem icon

LOGO Challenge 5 - Patch

Using LOGO, can you construct elegant procedures that will draw this family of 'floor coverings'?

First Forward Into Logo 12: Puzzling Sums

Stage: 3, 4 and 5 Challenge Level: Challenge Level:1

First Forward Into Logo
Previous: FF11

 

In FF9 you looked at several different sequences of numbers.
Here are more programs that generate sequences.

Now consider the following procedures.
TO SUMO :X :N
PR :X
WAIT 120
SUMO :X + :N :N + 2
END

What do you think is happening this time?
Try 'chasing' through the procedure the values: x= 1 and n = 1.
The output from this program is given on the right.

Now why not experiment further by changing the fourth line?
For example:
TO SUMO :X :N
PR :X
WAIT 120
SUMO :X + :N :N + 3
END

Or
SUMO :X * :N :N - 3
SUMO :X + :N * 2 :N + 1
SUMO :X - :N :N + 3 Etc
Any surprises?
turtle
1
2
5
10
17
26
37
50
65
82
101
122
stopped
in SUMO

2
6
8
8
6
2
-4
-12
-22
-34
-48
stopped
in SUMO

You might like to learn more Logo programming with Muggles, Logo and Gradients if you have not worked through it yet.