sdate at everestkc.net
Sun Dec 12 12:42:41 PST 2004
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).
More information about the Squeakland