blob: a5619aae786723431ce63ad5dbc6a8dd688e2b2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import gleam/io
import gleam/int
import gleam/list
pub fn main() {
let x = list.repeat(int.random(0, 5), times: int.random(0, 3))
io.debug(x)
let result = case x {
[] -> "Empty list"
[1] -> "List of just 1"
[4, ..] -> "List starting with 4"
[_, _] -> "List of 2 elements"
_ -> "Some other list"
}
io.debug(result)
}
|