I'm playing around with some turtle type graphics while getting the hang of this program.
I don't seem to be able to get the broadcast to repeat. I'm expecting the routine below to draw a spiral, but the broadcast to circles does not get repeated.
[blocks]
<repeat( 6
<broadcast[ circles]
[/blocks]
I expected the broadcast be called 6 times, but instead it gets called once and then stops.
[blocks]
<when I receive[ circles
<change{side }by( 1
<repeat( 12
<move(side )steps>
<turn cw( 30 )degrees>
[/blocks]
I can work around it by skipping the broadcast and using nested loops - that works fine, but I would like to be able to call named broadcasts, as it would make it easier to keep track to code later on when it the code gets more complicated.
Am I overlooking something? How can broadcasts be called more than once?
Thanks
Offline
Well, it actually does it six times, but it does it all at once, and the script therefore can't do it.
You need to broadcast[ ]and wait block.
Last edited by scimonster (2011-05-22 10:23:50)
Offline
wuzel wrote:
Thanks a million scimonster - changing from broadcast to broadcast and wait did the trick!
It's also solved the mystery of when on earth you would use broadcast and wait.
Glad to be of service!
Offline