aboutsummaryrefslogtreecommitdiff
path: root/tests/recurse.hgn
blob: bf9a0fd8afa697301d758d6eda0ffe2fedb5f2ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
main := proc() {
    print_up_to(read_int(0))
    exit(0)
}

print_up_to := proc(n) {
    print(n)
    if n > 0 {
        print_up_to(n - 1)
    }
}