Browse Source

Add return types to examples

github-actions
Garrit Franke 2 years ago
parent
commit
cdfbfa9899
  1. 2
      examples/ackermann.sb
  2. 2
      examples/fib.sb
  3. 2
      examples/greeter.sb

2
examples/ackermann.sb

@ -4,7 +4,7 @@ fn main() {
println(ackermann(m, n))
}
fn ackermann(m: int, n: int) {
fn ackermann(m: int, n: int): int {
if m == 0 {
return n + 1
} else if n == 0 {

2
examples/fib.sb

@ -3,7 +3,7 @@ fn main() {
println(fib(num))
}
fn fib(n: int) {
fn fib(n: int): int {
if 1 >= n {
return n
}

2
examples/greeter.sb

@ -2,6 +2,6 @@ fn main() {
println(greet("World"))
}
fn greet(name: string) {
fn greet(name: string): string {
return "Hello " + name
}

Loading…
Cancel
Save