Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Un-bitrot nqp/rc-man-or-boy-test
  • Loading branch information
Geoffrey Broadwell committed Jun 17, 2014
1 parent 655c508 commit f079596
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nqp/rc-man-or-boy-test
Expand Up @@ -2,8 +2,11 @@
try { nqp::getcomp('nqp').eval('pir::getinterp__P().recursion_limit(100000)') }

sub A ($k, $x1, $x2, $x3, $x4, $x5) {
my $B := sub () { A(--$k, $B, $x1, $x2, $x3, $x4) };
my $B; $B := sub () { A(--$k, $B, $x1, $x2, $x3, $x4) };
$k <= 0 ?? $x4() + $x5() !! $B();
}

say(A(+@ARGS[1], sub(){1}, sub(){-1}, sub(){-1}, sub(){1}, sub(){0}));
sub MAIN(*@ARGS) {
say(A(+@ARGS[1], my sub(){1}, my sub(){-1}, my sub(){-1},
my sub(){1}, my sub(){0}));
}

0 comments on commit f079596

Please sign in to comment.