[Rio-pm] [OT-GOLF] Merge

Fernando Oliveira fernandocorrea em gmail.com
Quinta Fevereiro 4 05:50:44 PST 2010


ainda mais feio:

sub merge{@a=split//,shift;@b
=split//,shift;join"",map{$a[$_].$b[$_]}0..(@a+ em b)}

Just another Perl Hacker,
Fernando (SmokeMachine)
http://perl-e.org
Sent from Rio De Janeiro, RJ, Brazil


2010/2/4 Fernando Oliveira <fernandocorrea em gmail.com>

> Feio, mas funciona e é menor:
>
> sub merge{@a=split//,shift;@b
> =split//,shift;join"",map{$a[$_].$b[$_]}0..($#a+$#b)}
>
>
> Just another Perl Hacker,
> Fernando (SmokeMachine)
> http://perl-e.org
> Sent from Rio De Janeiro, RJ, Brazil
>
>
> 2010/2/4 Fernando Oliveira <fernandocorrea em gmail.com>
>
> 2a:
>>
>> sub merge{@a=split//,shift;@b
>> =split//,shift;join"",map{$a[$_].$b[$_]}0..($#a>$#b?$#a:$#b)}
>>
>>
>> Just another Perl Hacker,
>> Fernando (SmokeMachine)
>> http://perl-e.org
>> Sent from Rio De Janeiro, RJ, Brazil
>>
>>
>> Em 4 de fevereiro de 2010 11:38, Fernando Oliveira <
>> fernandocorrea em gmail.com> escreveu:
>>
>> sub merge{@a=split//,shift;@b
>>> =split//,shift;join"",map{shift(@a).shift(@b)}0..($#a>$#b?$#a:$#b)}
>>>
>>
>>
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/rio-pm/attachments/20100204/e7ec0376/attachment.html>


Mais detalhes sobre a lista de discussão Rio-pm