aboutsummaryrefslogtreecommitdiff
path: root/challenge-017/zapwai/perl/ch-1.pl
blob: afa8d4e8081cb8424228c6c13962081fbf6cdd9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use v5.38;
sub A($m, $n) {
    if ($m == 0) {
	return $n + 1;
    } elsif ($n == 0) {
	return A($m - 1, 1);
    } else {
	return A($m - 1, A($m, $n - 1));
    }
}

say A(1,2);