Loops?

338 views
Skip to first unread message

Laurent Casa

unread,
Dec 29, 2013, 8:03:47 AM12/29/13
to puzzle...@googlegroups.com
Hi! Sorry if it has been already asked, but I can't find how startloop and endloop works. 
They appear only in 'rigid bodies' part of the documentation but it doesn't help me.  

Thanks ;)

Stephen Lavelle

unread,
Dec 29, 2013, 9:06:24 AM12/29/13
to Laurent Casa, puzzle...@googlegroups.com
it loops a section of rules until no more changes are made


--
You received this message because you are subscribed to the Google Groups "PuzzleScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puzzlescript...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Laurent Casa

unread,
Dec 29, 2013, 9:27:36 AM12/29/13
to puzzle...@googlegroups.com, Laurent Casa
Thanks! So I tried:

random [Background no Player]->[wall]

which create a wall somewhere each turn.And this:

Startloop
random [Background no Player]->[wall]
Endloop

Fills the whole level with walls. (May help some beginners like me...)

Alan Hazelden

unread,
Dec 31, 2013, 8:15:23 AM12/31/13
to Laurent Casa, puzzle...@googlegroups.com
Note that this:


Startloop
random [Background no Player]->[wall]
Endloop

is equivalent to this:

[Background no Player]->[wall]

Because a non-random rule will be applied repeatedly until it no longer applies anywhere.

If you had more than one rule in the loop however, it *would* be different.

Hope that makes sense/is useful!


--

Laurent Casa

unread,
Dec 31, 2013, 9:48:14 AM12/31/13
to puzzle...@googlegroups.com
Oh yes thanks, clearer now :)


Reply all
Reply to author
Forward
0 new messages