Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Mouq
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mouq/50660c17d7cd617f8537 to your computer and use it in GitHub Desktop.
Save Mouq/50660c17d7cd617f8537 to your computer and use it in GitHub Desktop.
sub Pm's-Q2 (@a) {
my @indices := (^(2*@a)).map: {
$_ %% 2 , ($_/2).floor
}
@indices.map: -> [Bool $switch, Int $index] {
$switch ?? $index !! @a[$index, $index]
}
}
say Pm's-Q2(my @ = "a"..* )[^100].perl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment