~garritfra/antimony

ref: 5e8aad974f24e782bf8ee9319a238ee1aa0892a0 antimony/examples/ackermann.sb -rw-r--r-- 276 bytes
5e8aad97Garrit Franke fix(ci): deploy action 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() {
    let m = 3
    let n = 3
    println(ackermann(m, n))
}

fn ackermann(m: int, n: int): int {
    if m == 0 {
        return n + 1
    } else if n == 0 {
        return ackermann(m - 1, 1)
    } else {
        return ackermann(m - 1, ackermann(m, n - 1))
    }
}