Skip to content

Commit

Permalink
Correct other code
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Jan 23, 2024
1 parent c4cace1 commit 17d738a
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import gleam/io
import gleam/int

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

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

// Match any other value and assign it to a variable
other -> "It is " <> int.to_string(other)
}
io.debug(result)
}

0 comments on commit 17d738a

Please sign in to comment.