Control Flow
Loop Control
Imported from the upstream Vibescript examples at control_flow/loop_control.vibe and runnable in the browser today.
Source
control_flow/loop_control.vibe
def odds_below(limit)
out = []
n = 0
while n < limit
n = n + 1
if n == limit
break
end
if n % 2 == 0
next
end
out = out + [n]
end
out
end
def run
odds_below(10)
end
Output
Press run to execute run from this example.