aboutsummaryrefslogtreecommitdiffstats
path: root/progs/tests/factorial.sy
blob: 770bc335aa5575e61522e865600ae979a7f51d6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
factorial :: fn n: int -> int {
    if n <= 1 {
        ret 1
    }
    ret n * factorial(n - 1)
}

start :: fn {
    factorial(5) <=> 120
    factorial(6) <=> 720
    factorial(12) <=> 479001600
}