Lua - Repeat until loop Posted on 2017-08-10 | Lua 的 repeat until 寫法如下,repeat until 區塊內帶入要運行的動作,until 後帶上要跳脫迴圈的條件即可。 123repeat ...until condition 像是要簡單的跑迴圈五次,然後印出 1 到 5 的數值,就可以像下面這樣撰寫: 123456local idx = 1local count = 5repeat print(idx) idx = idx + 1until idx > count Link Programming in Lua : 4.3.3