RosettaCodeData/Task/Ackermann-function/Perl-6/ackermann-function-2.pl6
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

3 lines
171 B
Raku

multi sub A(0, Int $n) { $n + 1 }
multi sub A(Int $m, 0 ) { A($m - 1, 1) }
multi sub A(Int $m, Int $n) { A($m - 1, A($m, $n - 1)) }