Skip to content
Course map | Lesson 2 of 5

Control Flow · 3.2

Basic match

All lessons are open — jump whenever you need.

match is Zolo's pattern matching — more powerful than a switch:

let day = 3
let name = match day {
    1 => "Monday",
    2 => "Tuesday",
    3 => "Wednesday",
    4 => "Thursday",
    5 => "Friday",
    _ => "Weekend",
}
print(name) // Wednesday

Goal: Use match to classify a score (0-100) into a grade (A, B, C, D, F).

lesson-3-2.zolo
Program output

Run the code to see the output

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br