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

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
主站蜘蛛池模板: 南丹县| 金阳县| 栾城县| 九江县| 阜宁县| 蛟河市| 三穗县| 竹山县| 岗巴县| 达日县| 高碑店市| 格尔木市| 沧源| 东山县| 平顺县| 天峨县| 定远县| 时尚| 牡丹江市| 巢湖市| 尼玛县| 宜川县| 淳安县| 灵丘县| 贵定县| 和龙市| 滦南县| 广德县| 萨嘎县| 翁牛特旗| 城口县| 宜丰县| 曲阳县| 绵阳市| 陇南市| 大城县| 左权县| 花莲县| 杭锦旗| 北流市| 天水市|