Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
15
Task/Repeat/Gleam/repeat.gleam
Normal file
15
Task/Repeat/Gleam/repeat.gleam
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import gleam/io
|
||||
|
||||
pub fn main() {
|
||||
repeat(3, fn() { io.println("hello") })
|
||||
}
|
||||
|
||||
pub fn repeat(times: Int, func: fn() -> Nil) -> Nil {
|
||||
case times {
|
||||
_ if times < 1 -> Nil
|
||||
_ -> {
|
||||
func()
|
||||
repeat(times - 1, func)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue