RosettaCodeData/Task/Ackermann-function/Perl-6/ackermann-function-2.pl6

4 lines
171 B
Raku
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
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)) }