Professional Documents
Culture Documents
Logo Dance: 620 Control & Elementary Programming Course
Logo Dance: 620 Control & Elementary Programming Course
620 Control
&
Elementary
Programming
Course
Type in
repeat 5 [ fd 40 rt 72 ]
Try this:
If you are not sure what is happening, put in a wait. It will go slower.
blue
blue
Investigate, improve on the polygon program and try your own tests.
What polygons can you make?
orange
to redcircle
set pc 4 setfc 4
repeat 360 [ fd2 rt 1]
pu
rt 90 fd 20
fill
bk 90 lt 20
end
You have defined the procedure redcircle- look in the text window
(commander) and check what the computer says.
What happens? Look at what the computer tells you in the text window,
There are four mistakes in this procedure. Use the edall to enter the
editor and cursor keys to go back and change them. (You may only see
two or three at first.)
To actually tell the computer that you've edited the procedure you must
File/Save and Exit. Two errors are easy to find. They are called syntax
errors- errors that break the turtles rules of spelling and grammar. The
other two are logical errors- thats down to you. You are correctly telling
the turtle to something that you don’t want. Don’t believe me-type this.
redcircle
redcircle
Now type
arcright 40 2
What happens?
Now write one called arcleft.
It called circle. Then 20 times drew an invisible spoke from a fixed point
to the rim. Here I called ray.
Can you do the same? Can you make the rays fatter? Can you make the
rays shorter?
yellow
The three fill commands are not reliable, and are a great challenge to
use. fill (fill “true) (fill “false)
The turtle cannot spell ‘colour’- he went to school in SouthPark.
Investigate how to make the more difficult colours, like pink, crimson
and lime green.
Make five different types of green balloon and name the colours.
Investigate the colours found in a Monet painting.
Investigate what happens to colour when it gets further away.
Investigate the colour of skin. Use pictures in a magazine. See how
Michelangelo did it, see how Rubens did it.
repeat 255
[setpc (list repcount repcount 0) fd repcount+1 rt 70]
white
sound [ 440 200 880 200 440 200 880 100 220 50 ]
You can make a tune this way. Here is the note table to help you
A better way, because it is easier to read is to write some procedures. One for each note.
to a
sound [440 200]
end
to c
sound [440 200]
end
to b
sound [ 493 200]
end
to tune
acaabca
end
We could do with some pauses between the notes- lets call them pp
to pp
wait 20
end
to tune
a pp c pp a a pp b pp c pp pp a
end
If you study an instrument there are many other experiments you might like to try.
How do you program a tune into your mobile phone.
Here is a tune to try.
VERSE CHORUS
GGGGFEGCDEEEDC GFEGCDEC
AAAABCBCAGAGFE ABCBCAGE
GGGGFEGCDEEEDC GFEGCDEC
CCDDCBC CCCC CCDDCBC CCCC
white