This is the picture at the very
beginning. There is a intersection of a main road and a smaller road. There
is also a highway on the left of the picture.
cars on the black road have the
green light; cars on the smaller road stopped at the red light.
the purple car that came out of
the parking lot the wrong way crashed into the red car at the middle if
the intersection
this is the picutre at the
very end.to black-yellow
setc-of 0 black
setc-of 1 yellow
end
to gray-go
setc-of 1 black
setc-of 2 red
setc-of 5 black
setc-of 4 green
cars-go-gray
end
to gray-yellow
setc-of 4 black
setc-of 3 yellow
end
to black-go
setc-of 3 black
setc-of 5 red
setc-of 2 black
setc-of 0 green
cars-go-black
end
turtles-own [speed2]
to black-go-2
setc-of 3 black
setc-of 5 red
setc-of 2 black
setc-of 0 green
if who > 5 and who <= 55 [fd speed2]
if who >= 56 and who <= 95 [fd speed2]
end
to black-go-3
setc-of 3 black
setc-of 5 red
setc-of 2 black
setc-of 0 green
if who > 5 and who <= 55 [fd 606]
if who >= 56 and who <= 95 [fd 606]
if who > 5 and who <= 55 [setcolor
0]
end
to cars-go-black
if who > 5 and who <= 55 [fd 1010]
if who >= 56 and who <= 95 [fd 1010]
end
to proper-direction
if who >= 96 and who <= 125 [lt 90]
if who >= 125 and who <= 165 [rt 90]
end
to cars-go-gray
if who >= 96 and who <= 125 [fd 1010]
if who > 125 and who <= 165 [fd 1010]
end
to crash-red-car
if who >= 166 and who <= 175 [seth
270 fd 5]
if who >= 166 and who <= 175 [rt 90
fd 30 lt 90 fd 5 rt 90 fd 20]
end
to reset-red-car
if who >= 166 and who <= 175 [seth
180 fd 50]
if who >= 166 and who <= 175 [lt 90
fd 10]
end
to crash-purple-car
if who >= 176 and who <= 186 [seth
180 fd 4 rt 90]
if who >= 176 and who <= 186 [fd 35
lt 90 fd 40]
end
to reset-purple-car
if who >= 176 and who <= 186 [seth
0 fd 40 rt 90]
if who >= 176 and who <= 186 [fd 35
lt 90 fd 4]
end
turtles-own [speed]
to highway-move
if who >= 187 and who <= 279 [fd speed]
end
to crash
if who = 186 [seth 270 fd 3]
if who = 182 [seth 220 fd 4]
if who = 176 [seth 290 fd 2]
if who = 168 [seth 190 fd 2]
if who = 169 [seth 90 fd 3]
if who = 170 [seth 20 fd 2]
end
to tow-truck
if who >= 96 and who <= 125 [setcolor
7]
if who >= 280 [seth 180 fd 6]
end
to tow-truck-go
if who >= 280 [seth 270 fd 40]
end
to tow-truck-tow
if who >= 280 [seth 270 fd 30]
if who = 186 [die]
if who = 182 [die]
if who = 176 [die]
if who = 168 [die]
if who = 169 [die]
if who = 170 [die]
if who >= 172 and who <= 175 [die]
if who >= 166 and who <= 175 [seth
270 fd 30]
if who >= 176 and who <= 186 [seth
270 fd 30]
end
observer -
;;Anthony Kang & Betsy McDonald
to setup
setc-of 0 green
setc-of 1 black
setc-of 2 black
setc-of 3 black
setc-of 4 black
setc-of 5 red
end
to cars-black
crt 10
end