Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add rc-man-or-boy-test
  • Loading branch information
Geoffrey Broadwell committed Dec 10, 2012
1 parent 7cf00e5 commit ee77445
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nqp/rc-man-or-boy-test
@@ -0,0 +1,6 @@
sub A ($k, $x1, $x2, $x3, $x4, $x5) {
my $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}));
8 changes: 8 additions & 0 deletions perl5/rc-man-or-boy-test
@@ -0,0 +1,8 @@
sub A {
my ($k, $x1, $x2, $x3, $x4, $x5) = @_;
my($B);
$B = sub { A(--$k, $B, $x1, $x2, $x3, $x4) };
$k <= 0 ? &$x4 + &$x5 : &$B;
}

say A($ARGV[0], sub{1}, sub{-1}, sub{-1}, sub{1}, sub{0});
6 changes: 6 additions & 0 deletions perl6/rc-man-or-boy-test
@@ -0,0 +1,6 @@
sub A ($k is copy, $x1, $x2, $x3, $x4, $x5) {
my $B = sub () { A(--$k, $B, $x1, $x2, $x3, $x4) };
$k <= 0 ?? $x4() + $x5() !! $B();
}

say A(+@*ARGS[0], sub{1}, sub{-1}, sub{-1}, sub{1}, sub{0});
7 changes: 7 additions & 0 deletions timeall
Expand Up @@ -171,6 +171,13 @@ my %TESTS = (
perl6 => [qw( BENCH/perl6/rc-forest-fire 30 20 10 )],
nqp => [qw( BENCH/nqp/rc-forest-fire 30 20 10 )],
},
{
name => 'rc-man-or-boy-test',
skip => [qw( )],
perl5 => [qw( BENCH/perl5/rc-man-or-boy-test 10 )],
perl6 => [qw( BENCH/perl6/rc-man-or-boy-test 10 )],
nqp => [qw( BENCH/nqp/rc-man-or-boy-test 10 )],
},
],
);
my %FORMATTER = (
Expand Down

0 comments on commit ee77445

Please sign in to comment.