[MWForum]MIA, Ask an Expert: gravity, asciis, ...

Mike Sandy mwforum@lists.mathcats.com
Sun, 10 Oct 2004 15:33:55 +0100


> I've been thinking about this. I believe that
> since the speed of computers increase exponentially
> fd.slow should use exponents too:

Does the speed of a turtle, in fact,
increase exponentially with the computer
rating? I've no way of knowing.
It doesn't really matter, since it easy
to allow for the computer rating.

I've found that a turtle will move
1 unit given the instruction:
 repeat 100[repeat 1000[fd 0.00001]]
It takes 38.4 sec. at 1.1 GHz. 
I would guess even at 3 GHz it is still 
going to be very slow!

I had to use nested repeats as the 
maximum value of :n for repeat :n[...],
is 9999.

So there is plenty of scope to control the turtle
speed. 
One way to cover (most) computers would
be to introduce a factor, comp_f. (as a projectvar?),
or simply to use a value in the proc as decided by 
experiment.

to fd_slow :dist
 repeat :dist / speed * comp_f [fd speed / comp_f]
end

speed - the speed of the turtle.

On my machine, with slider range 1 - 20, comp_f = 50
might do. 

Mike


> Hi Mike,
> 
> I've been thinking about this. I believe that
> since the speed of computers increase exponentially
> fd.slow should use exponents too:
> 
> 
> to fd.slow :dist
> let [val power 2 20 - speed]
> repeat :val [fd :dist / :val]
> end
> 
> This works with a slider 0-20.