Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[99probs] GLR fix P17-topo.pl
  • Loading branch information
stmuk committed Sep 16, 2015
1 parent bcc9506 commit c29c3b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions categories/99-problems/P17-topo.pl
Expand Up @@ -13,19 +13,18 @@ =head1 Example
=end pod

sub split-list(@list, $length)
{
sub split-list(@list, $length) {
my $i = 0;

gather while $i <= $length {
take [ gather while $i <= $length {
$i++ and take @list.[0];
$i++ and take @list.shift;
} ];

take [ @list ];
}
}

say split-list(('a' xx 20).list, 8).list.perl;
say split-list(['a' xx 20], 8).list.perl;

# vim: expandtab shiftwidth=4 ft=perl6

0 comments on commit c29c3b4

Please sign in to comment.