Open
Description
Hi!
I am totally new to the language, just started playing with the playground after hearing about Gleam from a Red Badger meet-up.
As I was mucking around, I made light changes to the examples involving random inputs as follows (e.g. this), which allows me to see different cases being triggered in the output.
import gleam/int
import gleam/io
pub fn main() {
example()
example()
example()
}
fn example() {
let x = int.random(5)
io.debug(x)
let result = case x {
// Match specific values
0 -> "Zero"
1 -> "One"
// Match any other value
_ -> "Other"
}
io.debug(result)
}
Just wonder whether this is an ever slightly easier example for absolute beginners to work through.
Metadata
Metadata
Assignees
Labels
No labels