How might one create a script to draw a spiral? I mistakenly thought that if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta is not dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Hi Randy --
Try first with circles and changing the angle and then the distance. Note that the smaller the angle, the large the circle (the smaller the curvature of the circle). The longer the distance traveled the larger the circle. You will probably want to use the little menu in front of the property "heading" to give it more decimal places. Make variables to hold the changing quantities. Try:
forward by 5 turn by angle angle decrease by 0.1
and see what happens.
This is a constant decrease of the angle.
Try
forward by distance turn by 5 distance increase by 2
and see what happens. This is a constant increase distance.
Try accelleration in each of these examples and see what happens.
Then try a scheme in which the angle and the distance are both changed in the same script.
This should provide some insight about spirals.
Cheers,
Alan
forward by 5 At 11:57 AM 12/6/2004, Randy Heiland wrote:
How might one create a script to draw a spiral? I mistakenly thought that if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta is not dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Hi Randy,
Attached is a quick, if somewhat simple-minded, fix.
Best,
John
On Mon, 6 Dec 2004 14:57:50 -0500, Randy Heiland heiland@indiana.edu wrote:
How might one create a script to draw a spiral? I mistakenly thought that if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta is not dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
To John and Randy
By the way, headingTheta is part of the vector category in etoys, has a different purpose and orientation than "heading", and is not needed for making spirals or other LOGO like geometric figures. "headingTheta" (and the rest of the vector stuff) is usually not visible in a vanilla Etoy system. How did you get it to be visible in yours?
Cheers,
Alan
-----------
At 06:31 AM 12/7/2004, JOHN VOIKLIS wrote:
Hi Randy,
Attached is a quick, if somewhat simple-minded, fix.
Best,
John
On Mon, 6 Dec 2004 14:57:50 -0500, Randy Heiland heiland@indiana.edu wrote:
How might one create a script to draw a spiral? I mistakenly thought that if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta is not dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
-- ***FOR ALL THOSE WHO INCLUDE ME IN THEIR ADDRESS BOOKS, PLEASE CHANGE MY ADDRESS TO: voiklis @gmail.com*** _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Uh, I said "Squeak" backwards 3 times really fast? :) It's possible that my environment may be a bit screwy. Early on I was using some full-blown version of Squeak, but thought that I was currently using the Etoys version. The world -> desktop menu -> help -> "about this system" tells me I'm running Squeakland 3.8.5976 update #371
--Randy
-----Original Message----- From: Alan Kay [mailto:alan.kay@squeakland.org] Sent: Tuesday, December 07, 2004 4:05 PM To: JOHN VOIKLIS; Randy Heiland Cc: squeakland@squeakland.org Subject: Re: [Squeakland] spiral
To John and Randy
By the way, headingTheta is part of the vector category in etoys, has a different purpose and orientation than "heading", and is not needed for making spirals or other LOGO like geometric figures. "headingTheta" (and the rest of the vector stuff) is usually not visible in a vanilla Etoy system. How did you get it to be visible in yours?
Cheers,
Alan
At 06:31 AM 12/7/2004, JOHN VOIKLIS wrote:
Hi Randy,
Attached is a quick, if somewhat simple-minded, fix.
Best,
John
On Mon, 6 Dec 2004 14:57:50 -0500, Randy Heiland heiland@indiana.edu
wrote:
How might one create a script to draw a spiral? I mistakenly thought
that
if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta
is not
dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
-- ***FOR ALL THOSE WHO INCLUDE ME IN THEIR ADDRESS BOOKS, PLEASE CHANGE MY ADDRESS TO: voiklis @gmail.com*** _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Hi, Randy/Alan -- Randy is indeed using the latest/greatest "Etoy/Squeakland" version. Both "theta" and "headingTheta" appear by default in the geometry category of an object's viewer in this version. -- Kim
At 4:24 PM -0500 12/7/04, Randy Heiland wrote:
Uh, I said "Squeak" backwards 3 times really fast? :) It's possible that my environment may be a bit screwy. Early on I was using some full-blown version of Squeak, but thought that I was currently using the Etoys version. The world -> desktop menu -> help -> "about this system" tells me I'm running Squeakland 3.8.5976 update #371
--Randy
-----Original Message----- From: Alan Kay [mailto:alan.kay@squeakland.org] Sent: Tuesday, December 07, 2004 4:05 PM To: JOHN VOIKLIS; Randy Heiland Cc: squeakland@squeakland.org Subject: Re: [Squeakland] spiral
To John and Randy
By the way, headingTheta is part of the vector category in etoys, has a different purpose and orientation than "heading", and is not needed for making spirals or other LOGO like geometric figures. "headingTheta" (and the rest of the vector stuff) is usually not visible in a vanilla Etoy system. How did you get it to be visible in yours?
Cheers,
Alan
At 06:31 AM 12/7/2004, JOHN VOIKLIS wrote:
Hi Randy,
Attached is a quick, if somewhat simple-minded, fix.
Best,
John
On Mon, 6 Dec 2004 14:57:50 -0500, Randy Heiland heiland@indiana.edu
wrote:
How might one create a script to draw a spiral? I mistakenly thought
that
if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta
is not
dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
-- ***FOR ALL THOSE WHO INCLUDE ME IN THEIR ADDRESS BOOKS, PLEASE CHANGE MY ADDRESS TO: voiklis @gmail.com*** _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Thanks Kim --
... we should probably write up something about what they mean and how they can be used ...
Cheers,
Alan
-------------
At 02:43 PM 12/7/2004, Kim Rose wrote:
Hi, Randy/Alan -- Randy is indeed using the latest/greatest "Etoy/Squeakland" version. Both "theta" and "headingTheta" appear by default in the geometry category of an object's viewer in this version. -- Kim
At 4:24 PM -0500 12/7/04, Randy Heiland wrote:
Uh, I said "Squeak" backwards 3 times really fast? :) It's possible that my environment may be a bit screwy. Early on I was using some full-blown version of Squeak, but thought that I was currently using the Etoys version. The world -> desktop menu -> help -> "about this system" tells me I'm running Squeakland 3.8.5976 update #371
--Randy
-----Original Message----- From: Alan Kay [mailto:alan.kay@squeakland.org] Sent: Tuesday, December 07, 2004 4:05 PM To: JOHN VOIKLIS; Randy Heiland Cc: squeakland@squeakland.org Subject: Re: [Squeakland] spiral
To John and Randy
By the way, headingTheta is part of the vector category in etoys, has a different purpose and orientation than "heading", and is not needed for making spirals or other LOGO like geometric figures. "headingTheta" (and the rest of the vector stuff) is usually not visible in a vanilla Etoy system. How did you get it to be visible in yours?
Cheers,
Alan
At 06:31 AM 12/7/2004, JOHN VOIKLIS wrote:
Hi Randy,
Attached is a quick, if somewhat simple-minded, fix.
Best,
John
On Mon, 6 Dec 2004 14:57:50 -0500, Randy Heiland heiland@indiana.edu
wrote:
How might one create a script to draw a spiral? I mistakenly thought
that
if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta
is not
dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
-- ***FOR ALL THOSE WHO INCLUDE ME IN THEIR ADDRESS BOOKS, PLEASE CHANGE MY ADDRESS TO: voiklis @gmail.com*** _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Phil
On Dec 6, 2004, at 2:57 PM, Randy Heiland wrote:
How might one create a script to draw a spiral? I mistakenly thought that if I did something like:
Fwd by 5 Turn by <obj> headingTheta + 2 penDown
that I might accomplish it. However, it seems that the headingTheta is not dynamically updated in this script, i.e. the heading never changes.
Thanks, Randy
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts.
I do not know if it is my email client (Mozilla Thunderbird on Win XP), but I do not get the attachments posted on this forum. First I thought it was a general problem when in an earlier thread Antonio Barros tried attaching a file (see: Error trying to share a project) and Ned Konz kept affirming that is was not. But now, since nobody is complaining I suspect it is only a problem on my side.
Is that true? -- Shashank
While it seems that Randy received my attachment (maybe because I sent it both directly and through the mailing list), I too have found that squeakland community messages often lack the files their authors claim to have attached.
Best--J
On Thu, 09 Dec 2004 01:33:34 -0600, Shashank Date sdate@everestkc.net wrote:
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts.
I do not know if it is my email client (Mozilla Thunderbird on Win XP), but I do not get the attachments posted on this forum. First I thought it was a general problem when in an earlier thread Antonio Barros tried attaching a file (see: Error trying to share a project) and Ned Konz kept affirming that is was not. But now, since nobody is complaining I suspect it is only a problem on my side.
Is that true? -- Shashank
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Shashank Date wrote:
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts.
I do not know if it is my email client (Mozilla Thunderbird on Win XP), but I do not get the attachments posted on this forum. First I thought it was a general problem when in an earlier thread Antonio Barros tried attaching a file (see: Error trying to share a project) and Ned Konz kept affirming that is was not. But now, since nobody is complaining I suspect it is only a problem on my side.
Is that true? -- Shashank
Hi,
I don't get the attachments either (mozilla on win98). They seem to be empty, when I choose "open" with mozilla mail.
--Christian
On December 9, 2004 02:33 am, Shashank Date wrote:
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts.
I do not know if it is my email client (Mozilla Thunderbird on Win XP), but I do not get the attachments posted on this forum. First I thought it was a general problem when in an earlier thread Antonio Barros tried attaching a file (see: Error trying to share a project) and Ned Konz kept affirming that is was not. But now, since nobody is complaining I suspect it is only a problem on my side.
well, I did not get any attachement with the previous emal on this thread, so it's not just your email client. I do think I get attachements sometimes though. My is KMail on SuSE/KDE.
Is that true? -- Shashank _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Hello,
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Is there a way to limit the loops of the spiral to some finite number, in eToys?
Something like "repeat 10 times" (as in Logo)?
Thanks, -- Shashank
If you looked at the script, I have a test which looks to see when Birdie's y coordinate is < 100. When it is the script is paused and the drawing of the spiral stops. In the running of the project Birdie begins in the center of the screen where its y coordinate is 390. As it moves out from the center y gets larger when it moves towards the top of the screen and smaller when it moves towards the bottom. I arbitrarily chose to look at the value of y when it's approaching the bottom of the screen.
Of course, there are other approaches one could take to stop the spiral...
Phil
On Dec 9, 2004, at 6:06 PM, Shashank Date wrote:
Hello,
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Is there a way to limit the loops of the spiral to some finite number, in eToys?
Something like "repeat 10 times" (as in Logo)?
Thanks, -- Shashank
Phil Firsenbaum wrote:
If you looked at the script, I have a test which looks to see when Birdie's y coordinate is < 100.
I did not get the attachment and so could not look at the script. Is the script available somwhere on the web?
When it is the script is paused and the drawing of the spiral stops. In the running of the project Birdie begins in the center of the screen where its y coordinate is 390. As it moves out from the center y gets larger when it moves towards the top of the screen and smaller when it moves towards the bottom. I arbitrarily chose to look at the value of y when it's approaching the bottom of the screen.
Oh, I see. I get the idea, but am still not sure how to "arbitrarily" choose to look at the value. Are you using the "random" number?
Of course, there are other approaches one could take to stop the spiral...
Yes, and the one I am interested in, is the one which allows us to control the number of times a certain script gets executed... a looping mechanism if you will.
Phil
-- Shashank
On Dec 9, 2004, at 6:06 PM, Shashank Date wrote:
Hello,
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Is there a way to limit the loops of the spiral to some finite number, in eToys?
Something like "repeat 10 times" (as in Logo)?
Thanks, -- Shashank
Hi --
Generally speaking, 5th graders get along very well without a repeat tile (but more and more older children are using etoys and thus we will include a loop construct some time this year).
But all the different kinds of loops are easy to make from two scripts, one to initialize, and one to do the loops and terminate. Use a variable if you are doing a "for" type loop.
So for player foo, "For i from 1 to 100 do mumble" would be:
foo loopInit i <- 1 foo start script loopBody
foo loopBody Test foo's i > 100 Yes foo stop script loopBody No mumble foo's i increase by 1
This is somewhat cumbersome, but is quite clear about what it does and when it does it. It has not come up as an issue with 5th graders because they stuff that we are encouraging them to do has either unbounded looping (the normal case) or the looping is stopped by some test of an external condition (as Phil suggested).
Cheers,
Alan
At 04:15 AM 12/11/2004, Shashank Date wrote:
Phil Firsenbaum wrote:
If you looked at the script, I have a test which looks to see when Birdie's y coordinate is < 100.
I did not get the attachment and so could not look at the script. Is the script available somwhere on the web?
When it is the script is paused and the drawing of the spiral stops. In the running of the project Birdie begins in the center of the screen where its y coordinate is 390. As it moves out from the center y gets larger when it moves towards the top of the screen and smaller when it moves towards the bottom. I arbitrarily chose to look at the value of y when it's approaching the bottom of the screen.
Oh, I see. I get the idea, but am still not sure how to "arbitrarily" choose to look at the value. Are you using the "random" number?
Of course, there are other approaches one could take to stop the spiral...
Yes, and the one I am interested in, is the one which allows us to control the number of times a certain script gets executed... a looping mechanism if you will.
Phil
-- Shashank
On Dec 9, 2004, at 6:06 PM, Shashank Date wrote:
Hello,
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Is there a way to limit the loops of the spiral to some finite number, in eToys?
Something like "repeat 10 times" (as in Logo)?
Thanks, -- Shashank
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Hello Alan,
Alan Kay wrote:
Hi --
Generally speaking, 5th graders get along very well without a repeat tile (but more and more older children are using etoys and thus we will include a loop construct some time this year).
Great ! Yes, we were doing fine without the repeat tile so far, but now our kids (6th and 7th graders) want to do more :-)
But all the different kinds of loops are easy to make from two scripts, one to initialize, and one to do the loops and terminate. Use a variable if you are doing a "for" type loop.
So for player foo, "For i from 1 to 100 do mumble" would be:
foo loopInit i <- 1 foo start script loopBody
And here we had to add: foo stop script loopInit
without which the clock kept ticking and the loopInit scipt kept executing over and over again. (There is an implicit infinite-loop on all the scripts).
foo loopBody Test foo's i > 100 Yes foo stop script loopBody No mumble foo's i increase by 1
This is somewhat cumbersome, but is quite clear about what it does and when it does it.
Worked like a charm ! Thanks for the hint.
It has not come up as an issue with 5th graders because they stuff that we are encouraging them to do has either unbounded looping (the normal case) or the looping is stopped by some test of an external condition (as Phil suggested).
Agreed.
Cheers,
Alan
Thanks, -- Shashank
Shashank --
See below ...
At 10:42 AM 12/12/2004, Shashank Date wrote:
Hello Alan,
Alan Kay wrote:
Hi --
Generally speaking, 5th graders get along very well without a repeat tile (but more and more older children are using etoys and thus we will include a loop construct some time this year).
Great ! Yes, we were doing fine without the repeat tile so far, but now our kids (6th and 7th graders) want to do more :-)
But all the different kinds of loops are easy to make from two scripts, one to initialize, and one to do the loops and terminate. Use a variable if you are doing a "for" type loop.
So for player foo, "For i from 1 to 100 do mumble" would be:
foo loopInit i <- 1 foo start script loopBody
And here we had to add: foo stop script loopInit
without which the clock kept ticking and the loopInit scipt kept executing over and over again. (There is an implicit infinite-loop on all the scripts).
No, there isn't. E.g. if you just say in another script foo loopInit this will fire this script once (this is why there is an explicit "start script" to start a script looping).
If you want to do this by hand, just click on the (!) on the left top edge instead of the clock.
Cheers,
Alan
foo loopBody Test foo's i > 100 Yes foo stop script loopBody No mumble foo's i increase by 1
This is somewhat cumbersome, but is quite clear about what it does and when it does it.
Worked like a charm ! Thanks for the hint.
It has not come up as an issue with 5th graders because they stuff that we are encouraging them to do has either unbounded looping (the normal case) or the looping is stopped by some test of an external condition (as Phil suggested).
Agreed.
Cheers,
Alan
Thanks, -- Shashank
Hello Alan,
without which the clock kept ticking and the loopInit scipt kept executing over and over again. (There is an implicit infinite-loop on all the scripts).
No, there isn't. E.g. if you just say in another script foo loopInit this will fire this script once (this is why there is an explicit "start script" to start a script looping).
Oh, yes. Thanks for correcting me.
If you want to do this by hand, just click on the (!) on the left top edge instead of the clock.
I keep forgetting about the execute once (!) option. Is there any way to NOT have the clock icon on the script? Alternatively, is there a more elegant solution to "stop script" regardless of which icons we click on (clock on the !)?
Cheers,
Alan
-- Shashank
foo loopBody Test foo's i > 100 Yes foo stop script loopBody No mumble foo's i increase by 1
This is somewhat cumbersome, but is quite clear about what it does and when it does it.
Worked like a charm ! Thanks for the hint.
It has not come up as an issue with 5th graders because they stuff that we are encouraging them to do has either unbounded looping (the normal case) or the looping is stopped by some test of an external condition (as Phil suggested).
Agreed.
Cheers,
Alan
Thanks, -- Shashank
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
At 04:18 PM 12/13/2004, Shashank Date wrote:
Hello Alan,
without which the clock kept ticking and the loopInit scipt kept executing over and over again. (There is an implicit infinite-loop on all the scripts).
No, there isn't. E.g. if you just say in another script foo loopInit this will fire this script once (this is why there is an explicit "start script" to start a script looping).
Oh, yes. Thanks for correcting me.
If you want to do this by hand, just click on the (!) on the left top edge instead of the clock.
I keep forgetting about the execute once (!) option. Is there any way to NOT have the clock icon on the script?
Why?
Alternatively, is there a more elegant solution to "stop script" regardless of which icons we click on (clock on the !)?
Why? (I don't understand your question here. Why would you want a clock on the (!)? It will only run the script once and then stops by itself.)
You can stop any script with the "stop script" command in "scripting". You can stop any ticking script by hand by clicking on the clock that is visibly showing ticking. You can do the same in a viewer. You can stop/start all scripts that are ticking by using the stop/go buttons (and these will also show you all the scripts in the environment, etc.).
Cheers,
Alan
-- Shashank
foo loopBody Test foo's i > 100 Yes foo stop script loopBody No mumble foo's i increase by 1
This is somewhat cumbersome, but is quite clear about what it does and when it does it.
Worked like a charm ! Thanks for the hint.
It has not come up as an issue with 5th graders because they stuff that we are encouraging them to do has either unbounded looping (the normal case) or the looping is stopped by some test of an external condition (as Phil suggested).
Agreed.
Cheers,
Alan
Thanks, -- Shashank
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Alan Kay wrote:
At 04:18 PM 12/13/2004, Shashank Date wrote:
I keep forgetting about the execute once (!) option. Is there any way to NOT have the clock icon on the script?
Why?
Ummm ... only to emphasize that this script is limited to single execution. Not a biggy, though, since you can always pause the clock.
Alternatively, is there a more elegant solution to "stop script" regardless of which icons we click on (clock on the !)?
Why? (I don't understand your question here. Why would you want a clock on the (!)?
Oops, a typo .. I meant to say clock OR the (!). Sorry for the confusion.
It will only run the script once and then stops by itself.
You can stop any script with the "stop script" command in "scripting". You can stop any ticking script by hand by clicking on the clock that is visibly showing ticking. You can do the same in a viewer. You can stop/start all scripts that are ticking by using the stop/go buttons (and these will also show you all the scripts in the environment, etc.).
Yes, we have used all these mechanisms, at some point or the other. The one thing we were looking for is to make a script pause for a specific number of ticks ... but did not succeed. I think, some kids were able to simulate that by introducing script variables.
Any ideas?
Thank you for being so patient. -- Shashank
Hi --
Having a script pause for a certain number of ticks is the same as having the script run for a certain number of ticks. If you use the looping mechanism I mentioned a few emails ago, you can see that a counting loop in etoys is the same as a counting clock or timer. Each tick is one clock time, and you can keep track of how many in a variable. You can test the variable and make another script start or stop ticking when the variable gets to a certain value.
Cheers,
Alan
---------
At 10:24 PM 12/13/2004, Shashank Date wrote:
Alan Kay wrote:
At 04:18 PM 12/13/2004, Shashank Date wrote:
I keep forgetting about the execute once (!) option. Is there any way to NOT have the clock icon on the script?
Why?
Ummm ... only to emphasize that this script is limited to single execution. Not a biggy, though, since you can always pause the clock.
Alternatively, is there a more elegant solution to "stop script" regardless of which icons we click on (clock on the !)?
Why? (I don't understand your question here. Why would you want a clock on the (!)?
Oops, a typo .. I meant to say clock OR the (!). Sorry for the confusion.
It will only run the script once and then stops by itself.
You can stop any script with the "stop script" command in "scripting". You can stop any ticking script by hand by clicking on the clock that is visibly showing ticking. You can do the same in a viewer. You can stop/start all scripts that are ticking by using the stop/go buttons (and these will also show you all the scripts in the environment, etc.).
Yes, we have used all these mechanisms, at some point or the other. The one thing we were looking for is to make a script pause for a specific number of ticks ... but did not succeed. I think, some kids were able to simulate that by introducing script variables.
Any ideas?
Thank you for being so patient. -- Shashank
Hi Alan,
Alan Kay wrote:
Having a script pause for a certain number of ticks is the same as having the script run for a certain number of ticks. If you use the looping mechanism I mentioned a few emails ago, you can see that a counting loop in etoys is the same as a counting clock or timer. Each tick is one clock time, and you can keep track of how many in a variable. You can test the variable and make another script start or stop ticking when the variable gets to a certain value.
Got it !
I think one of the kids had already figured this out before me ... bright kids, they all are !
And sometimes, I like to ask even if we get it working. Just to find out if there is a shorter, more direct way.
I hope you don't mind. (Actually, I know you don't ;-)
-- Shashank
Hi, Phil, Shashank, and fellow Squeakers -
We're looking into the "attachments" problem and will write soon explaining or suggesting what to do when you want to include an attachment to your message.
Perhaps the answer is uploading to a server and then putting a url in your mail pointing to that project? Mike/Bert is this an alternative method? We need to be able to share and show projects and I believe we used to be able to do so.
thanks folks and sorry for inconvenience while we straighten this out, Kim
At 6:15 AM -0600 12/11/04, Shashank Date wrote:
Phil Firsenbaum wrote:
If you looked at the script, I have a test which looks to see when Birdie's y coordinate is < 100.
I did not get the attachment and so could not look at the script. Is the script available somwhere on the web?
When it is the script is paused and the drawing of the spiral stops. In the running of the project Birdie begins in the center of the screen where its y coordinate is 390. As it moves out from the center y gets larger when it moves towards the top of the screen and smaller when it moves towards the bottom. I arbitrarily chose to look at the value of y when it's approaching the bottom of the screen.
Oh, I see. I get the idea, but am still not sure how to "arbitrarily" choose to look at the value. Are you using the "random" number?
Of course, there are other approaches one could take to stop the spiral...
Yes, and the one I am interested in, is the one which allows us to control the number of times a certain script gets executed... a looping mechanism if you will.
Phil
-- Shashank
On Dec 9, 2004, at 6:06 PM, Shashank Date wrote:
Hello,
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Is there a way to limit the loops of the spiral to some finite number, in eToys?
Something like "repeat 10 times" (as in Logo)?
Thanks, -- Shashank
Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Here are the attachments I referred to:
The most direct way of watching the value of y is to keep Birdie's viewer open. If you look in the Basic category, as Birdie moves you'll be able to see the values of its coordinates change.
To control the number of times a script is executed you probably want to create a variable (count) and then add a test to the script which waits for the value of the variable to reach a certain number, while someplace else in the script you increase the value of the variable each time the script is executed. If you're able to see the attached scripts, you'll see an example of a variable (size1) whose value increases as the script (spiral) is executed.
Hope this makes sense.
Phil
On Dec 11, 2004, at 7:15 AM, Shashank Date wrote:
Phil Firsenbaum wrote:
If you looked at the script, I have a test which looks to see when Birdie's y coordinate is < 100.
I did not get the attachment and so could not look at the script. Is the script available somwhere on the web?
When it is the script is paused and the drawing of the spiral stops. In the running of the project Birdie begins in the center of the screen where its y coordinate is 390. As it moves out from the center y gets larger when it moves towards the top of the screen and smaller when it moves towards the bottom. I arbitrarily chose to look at the value of y when it's approaching the bottom of the screen.
Oh, I see. I get the idea, but am still not sure how to "arbitrarily" choose to look at the value. Are you using the "random" number?
Of course, there are other approaches one could take to stop the spiral...
Yes, and the one I am interested in, is the one which allows us to control the number of times a certain script gets executed... a looping mechanism if you will.
Phil
-- Shashank
On Dec 9, 2004, at 6:06 PM, Shashank Date wrote:
Hello,
Phil Firsenbaum wrote:
Randy, I was playing with polygons and spirals last year and created the attached scripts. They use a variable (size1) for the length of the sides and I start Birdie in the center of the screen.
Is there a way to limit the loops of the spiral to some finite number, in eToys?
Something like "repeat 10 times" (as in Logo)?
Thanks, -- Shashank
squeakland@lists.squeakfoundation.org