This project is a sort of experiment that involves three blind
turtles in a race. The object of the race is to be the first turtle to
touch the golden star. Because the three turtles happen to be blind,
they must wander around aimlessly in hopes of accidentally running
into the star. To make things interesting, the turtles come in three
different sizes. The big turtle
takes very big steps and the turns in a random direction. The medium sized turtle takes medium
sized steps and then turns in a random direction. And the little turtle takes little
steps and then turns in a random direction. This experiment tries to
determine if any of the turtles has an advantage over another because
of its size.
The Code...
to race
; Loop until turtle t1 reaches the
; star. In the loop:
; 1) take a step (fd 10)
; 2) turn right a random amount
; 3) take another step
; 4) turn left a random amount
t1, forever [
fd 10
right random 90
fd 10
left random 90
; did t1 reach the goal?
if touching? "t1 "goal
[
stopme
]
wait 2
]
; The code is exactly like t1 except
; that t2 takes smaller steps
t2, forever [
fd 16
right random 90
fd 16
left random 90
if touching? "t2 "goal [
stopme
]
wait 2
]
; Same as t2 except that t3 takes
; even smaller steps.
t3, forever [
fd 25
right random 90
fd 25
left random 90
if touching? "t3 "goal [
stopme
]
wait 2
]
end