官术网_书友最值得收藏!

while loops

Syntactically, a while loop starts with the while keyword, followed by a Boolean condition and a do/end chunk. The loop will keep executing the chunk of code so long as the Boolean condition evaluates to true:

x = 10 -- Initialize a "control" variable

while x > 0 do -- Boolean condition: x > 0
print ("hello, world")

x = x - 1 -- Decrement the "control" variable
end
主站蜘蛛池模板: 含山县| 临洮县| 江安县| 开化县| 麻城市| 棋牌| 洪洞县| 商都县| 光泽县| 双牌县| 溆浦县| 岢岚县| 岚皋县| 万州区| 滨州市| 宜阳县| 沽源县| 孟连| 田东县| 邓州市| 壶关县| 蓝田县| 许昌县| 司法| 临沂市| 景泰县| 肇东市| 扬州市| 剑川县| 闽侯县| 定安县| 沈阳市| 红原县| 泾源县| 抚顺县| 溧水县| 汝州市| 襄樊市| 东兴市| 衡阳市| 太原市|