orsub zip { my $half = @_>>1; return @_[map { ($_&1 && $half) + ($_>>1) } 0 .. $#_]; }
sub zip { my $half = @_>>1; return @_[map { $_, $_+$half } 0 .. $half-1]; }
p.s. A common name for this kind of functionality is "zip". See Language::Functional for an implementation. SO I changed the name for the function to reflect this.
In reply to Re: perfect shuffle
by bart
in thread interleave (single shuffle)
by ysth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |