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

  • Lua Quick Start Guide
  • Gabor Szauer
  • 67字
  • 2021-08-05 10:30:43

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
主站蜘蛛池模板: 纳雍县| 垦利县| 泰安市| 抚宁县| 甘泉县| 金山区| 阿合奇县| 沙河市| 潞西市| 松潘县| 嘉善县| 安新县| 贵南县| 广州市| 绥阳县| 临江市| 祁连县| 酉阳| 天等县| 绥芬河市| 宁武县| 丰镇市| 翁源县| 航空| 安溪县| 新宾| 疏勒县| 涿鹿县| 霍林郭勒市| 仙游县| 大庆市| 武陟县| 象州县| 邓州市| 新津县| 盐津县| 丰宁| 额尔古纳市| 建昌县| 原阳县| 砚山县|