During the exam I (and other Perl programmer) were talking about how to do it in Perl, but different: $a and $b has each string, and we want to create in memory the zipped string.
I came across with this (I think, interesting) solution:
@b = split
//, $b;
$a =~ s!.!$&.shift@b!ge
Other suggestions of "interesting" ways to do it?
Another way (Score:2)
Re:Another way (Score:1)
Re:Another way (Score:2)
Actually I originally did it like this, just to have a substitution inside a substitution:
But I decided that destroying $b in the process might not be acceptable.
chop chop (Score:2)
Re:chop chop (Score:1)
Re:chop chop (Score:2)
Re:chop chop (Score:1)
During our discussion about an "interesting" solution, we could take advantage of chip. We thought of unshift, but that doesn't work for arrays.
Re:chop chop (Score:2)
Re:chop chop (Score:2)
Much like your original proposal, you can use:
Re:chop chop (Score:1)
use perl6 (Score:2)
Re:use perl6 (Score:1)
Re:use perl6 (Score:1)
HTML suckz.
Re:use perl6 (Score:1)
>> <<
Re:use perl6 (Score:2)
I measure neat in strokes (Score:2)
The zip in my solution is in $b.
Casey West
Re:I measure neat in strokes (Score:1)