Goal: Shake the ball and find out the answer to your question.
Vocabulary: seth (setheading), random
to shake
t1, repeat 10 [
setsh "8-ball
seth random 360
fd 15 bk 15
setsh "8-ball-t
fd 15 bk 15
]
setsh pick [sure! of_course! please_ask_later totally! nope yes! no no_way right_on duh!]
end
Notes Seth stands for "set heading" and is always followed by a number. Seth 0 points the turtle straight up. Seth random 360 means, "Choose any number from 0 to 359 and point to that heading." (There are 360 degrees in a circle, so the turtle might point in any direction.)
In the shake procedure, the magic 8-ball shakes a little bit before giving an answer.
What If?
Try different numbers after fd and bk.
What happens if the numbers are all the same?
What happens if the numbers are different?
Challenge
Experiment with other variations on the procedure to get a different jiggling effect:
Try changing the number after seth random or omitting that command.
Try including wait 1 in one or more places.
Try alternating between two shapes which are identically-sized.
|