Control Flow Details
Repeat Until
repeat ... until runs the body before checking the stop condition.
Repeat Until
repeat_until.lua
local target =
local count = 0
repeat
count = count + 1
until count >= target
print("target=" .. target)
print("count=" .. count)
local target =
local count = 0
repeat
count = count + 1
until count >= target
print("target=" .. target)
print("count=" .. count)
local target =
local count = 0
repeat
count = count + 1
until count >= target
print("target=" .. target)
print("count=" .. count)
condition last
A repeat loop always runs at least once because the condition comes after the body.