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

Re: LOGO-L> Re: LOGO-L> Is Logo old technology?



Ken Kahn wrote:
> Maybe I'm mistaken,
>but Microworlds doesn't really change Logo that much. It adds lots of
useful
>user interface gadgets and a very primitive, impoverished notion of
parallel
>processing. I am not aware of any way to synchronize parallel processes in
>Microworlds.

I think this MicroWorlds procedure (from MW help on waituntil and also
done?) does synchronise parallel processes:

to sq-circ
t1, pd launch [repeat 36 [fd 10 rt 10]]
; t1 draws a circle
t2, pd launch [repeat 4 [fd 50 rt 90]]
; t2 draws a square
waituntil [done? [repeat 36 [fd 10 rt 10]]]
; the procedure does not continue until the circle is finished
; so that the drawings of circles and square are synchronised
t1, pu rt random 360 fd random 50
t2, pu rt random 360 fd random 50
; repositions turtles for next drawing
sq-circ
end

>And the only way processes can communicate is via global
>variables. This is poor modularity and can lead to extremely hard to track
>down bugs. And in what sense is Microworlds object-oriented?


MicroWorlds has a turtlesown primitive that enables you to localise things
like the speed or reset position of a turtle which is, for instance,
simulating a horse. I'll paste in the MW help explanation here, which will
give us some sort of starting point for further discussion. I'm not trying
to suggest that MW is fully object orientated but code can reside on objects
such as colours, turtles, buttons. This gives students an introduction to
elementary oops concepts and for young kids I can't see the point in going
beyond that. MW and logo has local variables which would be the main thing,
wouldn't it? My main impression from doing a little bit of java oops earlier
this year is that everything is 10 times harder than in using logo.

<start of paste from MW help>
turtlesown word

Assigns a variable to all the turtles in the current project. This variable
can then be set to a specific value for each turtle. This command also
creates a new primitive made of the word set followed by the name of the
variable (e.g., turtlesown "speed creates a setspeed command as in t1,
setspeed 12).
There are two ways to get the value of a given turtle variable: you can talk
to a turtle and use the variable name to report the value (e.g., t1, show
speed displays 12 in this example) or you can use the turtle name followed
by 's (e.g., show t1's "speed displays 12).

Use remove to remove a turtle variable. This removes the named variable for
all the turtles in the project.
After a turtlesown instruction, the value of the variable is set to the
empty list (see the first three lines in the example below).
Example:

turtlesown "speed
t1, show speed
  (empty list)
t1, setspeed 10
t2, setspeed 20
t3, setspeed 5
t1, show speed
10
show t2's "speed
20
everyone [fd speed]
everyone [forever [fd speed]]

Choose Stop All from the Edit menu.

remove "speed
<end of paste from MW help>

-- Bill Kerr


---------------------------------------------------------------
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