clubby789 wrote:
I think there should be while loops! I always have to do things such as this:
[scratchblocks]
when gf clicked
wait until <(robots) = [10]>
repeat until < not(robots) < = [10]>>
Tell me if scratchblocks doesn't work!
You forgot to close it.
Edit: As in the [scratchblocks] tag.
Last edited by lalala3 (2013-01-21 11:53:01)
Offline
Allow me...
clubby789 wrote:
I think there should be while loops! I always have to do things such as this:
when gf clicked wait until <(robots) = [10]> repeat until < not(robots) < = [10]>>Tell me if scratchblocks doesn't work!
Offline
For something with a relatively simple workaround, I don't think this needs to be implemented.
If you really want a while loop, I wrote one in Insanity, when trying to figure out C blocks.
Offline
"While" loops are far more common than "until" loops in other languages, it might be better for Scratch to use them instead of/in addition to "until" loops.
Offline
OverPowered wrote:
"While" loops are far more common than "until" loops in other languages, it might be better for Scratch to use them instead of/in addition to "until" loops.
Not just more common, they're pretty much standard.
Offline
As standard as they may be, they may be harder to understand by the target audience of Scratch: Kids who are just starting to learn programming concepts, and use the program due to it being as close to the English (or their native) language as possible.
The functionality of a standard "while" loop even confuses me at times. Your typical Scratch user may interpret as the currently existing "forever if" loop:
when gf clicked forever if <[1] < [2]> say [do stuff] endBut, that would be the equivalent of something like this in an actual programming language:
while true do if 1 < 2 then //do stuff end end
The name of the "while" loop is quite misleading, considering Scratch is meant for absolute beginners. I don't support this idea.
Offline