Skip to content

Commit

Permalink
chore(examples): 📝 add more examples (8 & 9)
Browse files Browse the repository at this point in the history
  • Loading branch information
wowkster committed Apr 27, 2023
1 parent 79b3f95 commit 07c9a5e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/8_control_flow.leek
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn main() {
leak a = 69
leak b = 420

if a > b {
println("a is greater")
} else {
println("b is greater")
}
}
7 changes: 7 additions & 0 deletions examples/9_guard.leek
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn div(a: i32, b: i32) -> i32? {
unless b != 0 {
yeet None
}

yeet a / b
}

0 comments on commit 07c9a5e

Please sign in to comment.