My project is here :
parachuting跳伞
I 'd like to repeat 10 times
but I don't understand why only run it once
Who can help me ?
Thanks!
Last edited by liupengty (2012-03-07 08:31:18)
Offline
when green flag clicked
repeat (10)
set [tiaosanX] to (250)
forever if <(tiaosanX) > [-300]>
change [tiaosanX] by <pick random(-3)to(-1) >
end
end
I 'd like to repeat 10 timesLast edited by liupengty (2012-03-07 09:21:33)
Offline
Ok, here's the thing. The forever if block is synonymous to:
forever if <blah> blah endSo as soon as you enter a forever loop, even if it's forever if, you know you will never come out. Like a life sentence. So in your code, the forever block doesn't stop when tiaosanX is less than -300; it keeps waiting for it to get above -300 so it can evaluate again.
Offline