[MWForum]Procedure for getting many turtles onscreen at once.
Kathy Verzoni
mwforum@lists.mathcats.com
Thu, 4 Mar 2004 08:24:42 -0500
Hi Wendy -- Thanks for your thorough response to Mike's question. I'll make
sure that he gets it today. Regards, Kathy Verzoni
-----Original Message-----
From: mwforum-admin@lists.mathcats.com
[mailto:mwforum-admin@lists.mathcats.com]On Behalf Of Wendy Petti
Sent: Wednesday, March 03, 2004 3:15 PM
To: mwforum@lists.mathcats.com
Subject: RE: [MWForum]Procedure for getting many turtles onscreen at
once.
Hi Mike,
Yes, there is a way to "hatch" as many turtles as you'd like, under program
control.
The two procedures below "kill" the existing turtles on a page and hatch new
ones. You need to name the new turtles as they are hatched, and the
"hatchturtles" procedure automatically numbers them, starting with t1. (If
you need to retain turtles that already are numbered, you'll need to change
the naming scheme below.) The turtles are hatched at the center of the page
and they are hidden when first hatched. This gives you the opportunity to
place them in a new position and change their size and shape before making
them visible. You can also set an instruction for each newly-hatched
turtle.
The sample procedure below hatches a random number of new turtles (at least
10 and as many as 34). It sets them to moving in random directions. These
procedures were taken from an "anthill" project at OWL's MicroWorlds in
Action site; the ants appear to be pouring out of an anthill and the user
tries to guess how many ants are scurrying around the page.
http://mia.openworldlearning.org/ant_hill/ant_hill_6.htm
* * * * *
to killturtles
everyone [remove who]
end
to hatchturtles
make "no 1
sethowmany 10 + random 25
repeat howmany [newturtle word "t :no setsize 13 st setinstruction [forever
[fd 2]] seth random 360 make "no :no + 1]
end
* * * * *
But I'd also like to ask you: do you really need to hatch new turtles? If
a turtle is disappearing at the bottom of the page and then "another" turtle
is appearing at the top of the page, can you not use the same turtle for
this purpose without killing one and hatching another? Wouldn't this work
as well?
to hide-and-show
ht
setpos [0 250]
st
end
(using the desired coordinates instead of the samples above, of course)
Would you mind sharing the finished project with us? It sounds
interesting!!
Wendy Petti
OWL's MicroWorlds in Action
http://mia.openworldlearning.org
Math Cats
http://www.mathcats.com
> -----Original Message-----
> From: mwforum-admin@lists.mathcats.com
> [mailto:mwforum-admin@lists.mathcats.com]On Behalf Of Kathy Verzoni
> Sent: Tuesday, March 02, 2004 2:30 PM
> To: mwforum@lists.mathcats.com
> Subject: [MWForum]Procedure for getting many turtles onscreen at once.
>
>
> Hello, my name is Mike and I am a student of Dr. Verzoni. I was
> wondering if there was a certain procedure that you could enter in
> Microworlds Pro that would allow me to get many turtles onscreen at
> once. What I mean is that the turtles generate themeselves. As the
> user clicks on a turtle that has progressed toward the bottom of the
> screen, it dissapears. Then another hatches at the top of the screen.
> Thank you very much.
>
> _______________________________________________
> MWForum mailing list
> MWForum@lists.mathcats.com
> http://lists.mathcats.com/mailman/listinfo/mwforum
> Attachments archived at:
> http://www.mathcats.com/mwforum/attachments.html
> To unsubscribe or for administrative questions contact
> mailto:mwforum-admin@lists.mathcats.com
>
_______________________________________________
MWForum mailing list
MWForum@lists.mathcats.com
http://lists.mathcats.com/mailman/listinfo/mwforum
Attachments archived at:
http://www.mathcats.com/mwforum/attachments.html
To unsubscribe or for administrative questions contact
mailto:mwforum-admin@lists.mathcats.com