Control Flow
While Loop
Repeat work with a while loop.
Source
control_flow/while_loop.vibe
def countdown(start)
out = []
n = start
while n > 0
out = out + [n]
n = n - 1
end
out
end
def run
countdown(5)
end
Output
Press Run example to run this code.