[MWForum]How to slow down a turtle/car travelling around a road network
Mike Sandy
mwforum@lists.mathcats.com
Thu, 2 Oct 2003 11:43:10 +0100
Try:
to glide# :dist :speed
repeat :dist / :speed * 100
[fd .01 * :speed]
end
:speed 1 to 10
Mike
----- Original Message ----- > <GrahamWilliams@caulfieldgs.vic.edu.au> on
Thu, 2 Oct 2003 10:00:55 +1000 wrote:
> > I'm trying to help some students create a project as part of their maths
course. They have to import pages of maps from a local street directory and
then use a turtle [dressed as a car] to show the route they travel from
their house to our school. The idea is to place turtles [ which will be
hidden] all along the roads which they use to come to school. The car-
turtle will then 'drive' from hidden turtle to hidden turtle as it travels
around the road network. I'm using a procedure with towards and
lide - such as the following:
> > t1, towards "t2
> >
> > glide distance "t2 1
> >
> > towards "t3
> >
> > glide distance "t3 1
> >
> > towards "t4
> >
> > The only problem is that the car doesn't glide - it hurtles around the
network at a rate which breaks the speed limit!!!! Can anyone suggest a way
of making the car-turtle travel SLOWLY around the road network as it
'drives' from hidden turtle to hidden turtle? I've attached my practice
project so you can get some idea of what I'm trying to do. Many thanks
Graham Williams Melbourne Australia
.com