[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: LOGO-L> Re: Multiple Turtles





-----Original Message-----
From:	Yehuda Katz [SMTP:yehuka@beitberl.ac.il]
Sent:	Saturday, September 27, 1997 7:32 AM
To:	Jim Muller
Cc:	mills@ultranet.com; Logo-L
Subject:	Re: LOGO-L> Re: Multiple Turtles

I don't really know TELL and/or ASK. But try it yourself: How you find
the distance between two given turtles? In my proposed primitive all you
would have to say is:

	PR DIST TURTLE 1 TURTLE 2

("TURTLE" is my suggested name for the primitive, but it can be anything
other).

[RAY CATZEL]  The following is extracted from the MicroWorlds documentation and 
shows the neat way LCSI deals with this issue.  It has defined a primitive 
called "distance".......

distance turtle-name

Reports the distance between the current turtle and the turtle indicated. See 
towards.
Example:
In this example, there are two turtles on the page.

t1,
show distance "t2

122    Your answer will be different.

towards "t2

fd distance "t2	  T1 meets t2.

Set t1 to go Many Times and define the go procedure as follows. T1 will be 
"trapped" around t2:

to go

fd 1
if 100 < distance "t2 [towards "t2]
end

Ray Catzel
President  ComputerPals
Email:  learn@computerpals.on.ca
Internet:  http://www.computerpals.on.ca/~pals

---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home