aboutsummaryrefslogtreecommitdiff
path: root/lessons/src/lesson023_variable_patterns/code.gleam
blob: 78eb05046b5297609076799e1f0ac23e52d7e32c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gleam/io
import gleam/int

pub fn main() {
  let x = int.random(0, 5)
  io.debug(x)

  let result = case x {
    // Match specific values
    0 -> "Zero"
    1 -> "One"
    // Match any other value
    _ -> "Other"
  }
  io.debug(result)
}