[Squeakland] OLPC pen trails for turtle graphics

Dreyfuss Pierre-André (EDU) pierre-andre.dreyfuss at edu.ge.ch
Sun Nov 4 10:29:13 PST 2007


Hi,
With the olpc image, you'll find a 'repeat  times' tile un the miscellaneous category.


With squeakland, you have to build your own repeat structure.

Create a variable times.

Write a script repetition with a test on te tmes value

If the value is zero  the stop script repetition
if not then 
  decrement the times value by 1 and do what should be repeted.



In the main script  set the value of time at the number of repetition and start script repetition

stop script and start script are in the scripting category.

There is a problem if you have  other tiles after starting repetition, these tiles will be executed immediately and will not wait until repetition is finished. To correct this, you can put these commands in the yes branch of the test.

Regards.


-------- Message d'origine--------
De: squeakland-bounces at squeakland.org de la part de Karl
Date: jeu. 01/11/2007 10:06
À: Bill Kerr
Cc: squeakland org mailing list
Objet : Re: [Squeakland] OLPC pen trails for turtle graphics
 
He is using the OLPC etoy image.
Karl


Bill Kerr wrote:
> Simon Guest <simon.guest at tesujimath.org 
> <mailto:simon.guest at tesujimath.org>> wrote:
> A simple script like this:
>
> Repeat 2 times
>    Star forward by 100
>    Star turn by 90
> ---------------------------------
>
> I can't see how to program
> Repeat 2 times
> in etoys
> ie. to repeat something a certain number of times programmatically?
>
> I tried in the text editor too but didn't work:
> script3
> 4 timesRepeat:
>     [self forward: 5 * 10.
>     self turn: 90.
>     self forward: 50]
>
>
> -- 
> Bill Kerr
> http://billkerr2.blogspot.com/
>
> On Oct 21, 2007 5:10 AM, Simon Guest < simon.guest at tesujimath.org 
> <mailto:simon.guest at tesujimath.org>> wrote:
>
>     Hi,
>
>     I'm just about to start my own kids off on some OLPC Etoys
>     investigation, so I had a quick play, intending to make some turtle
>     style polygons.  It didn't work as I expected.
>
>     A simple script like this:
>
>     Repeat 2 times
>        Star forward by 100
>        Star turn by 90
>
>     did not leave an L shape trail as I expected, but a diagonal line from
>     the start to the finish position.
>
>     Is this how pen trails are supposed to work?  How do I draw a classic
>     polygon, where the start and finish positions are the same?
>     Currently no pen trail is left at all.
>
>     cheers,
>     Simon
>
>     _______________________________________________
>     Squeakland mailing list
>     Squeakland at squeakland.org <mailto:Squeakland at squeakland.org>
>     http://squeakland.org/mailman/listinfo/squeakland
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Squeakland mailing list
> Squeakland at squeakland.org
> http://squeakland.org/mailman/listinfo/squeakland
>   


_______________________________________________
Squeakland mailing list
Squeakland at squeakland.org
http://squeakland.org/mailman/listinfo/squeakland




More information about the Squeakland mailing list