mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 17:35:03 +01:00
fix return error
This commit is contained in:
parent
53c2cdb085
commit
131229686a
3 changed files with 22 additions and 9 deletions
25
test.sl
25
test.sl
|
|
@ -1,9 +1,18 @@
|
|||
fn test() {
|
||||
if true {
|
||||
print;
|
||||
} else if false {
|
||||
dont_print;
|
||||
} else {
|
||||
"uwu";
|
||||
fn fizzbuzz() {
|
||||
let i = 0;
|
||||
while i < 100 {
|
||||
# don't have function calls yet :(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn single_fizzbuzz(n) {
|
||||
if n % 15 == 0 {
|
||||
return "FizzBuzz";
|
||||
} else if n % 5 == 0 {
|
||||
return "Buzz";
|
||||
} else if n % 3 == 0 {
|
||||
return "Fizz";
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue