Control Flow
Case When
Imported from the upstream Vibescript examples at control_flow/case_when.vibe and runnable in the browser today.
Source
control_flow/case_when.vibe
def label(score)
case score
when 100
"perfect"
when 90, 95
"great"
else
"ok"
end
end
def run
[label(100), label(95), label(70)]
end
Output
Press run to execute run from this example.