in reply to Mixing up da Arrays (Golf)
Do I hear golf?
First at 48 chars, the one that modifies the original arguments like yours does:
and a safe one that doesn't do that at 59 chars:sub Mix { my@a;@_=grep{@$_?push@a,shift@$_:0}@_ while@_;@a }
sub MixS { my@a;for(my$i;@_;++$i){@_=grep{$i<@$_&&push@a,$$_[$i]}@_}@a }
|
---|
In Section
Seekers of Perl Wisdom