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

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
主站蜘蛛池模板: 会昌县| 百色市| 澜沧| 威宁| 广德县| 邹城市| 淳化县| 务川| 外汇| 科尔| 珲春市| 沾化县| 滕州市| 河南省| 五大连池市| 当阳市| 安乡县| 千阳县| 宣武区| 吉木乃县| 昆山市| 曲阳县| 和田市| 边坝县| 大冶市| 桦南县| 巴马| 桑日县| 平泉县| 贵南县| 米易县| 逊克县| 永新县| 崇阳县| 越西县| 巴马| 灯塔市| 商水县| 小金县| 交口县| 丰都县|