[Rio-pm] [OT-GOLF] Merge

Renan Rangel rvr777 em gmail.com
Quinta Fevereiro 4 09:26:54 PST 2010


Olá pessoal,

Vale dessa forma?

sub merge{@a=split//,pop;$_=pop;s/(.)/$1.shift em a/ge;$_.join'', em a}

--
Renan Rangel


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

> mais uma tacada:
>
> sub merge{$z="a";@{$z++}=split//for em _;join"",map{$a[$_].$b[$_]}0.. em a+@b}
>
>
> Just another Perl Hacker,
> Fernando (SmokeMachine)
> http://perl-e.org
> Sent from Rio De Janeiro, RJ, Brazil
>
>
> 2010/2/4 Daniel de Oliveira Mantovani <daniel.oliveira.mantovani em gmail.com
> >
>
> Ops ele diz sim desculpa....
>>
>> On 4 February 2010 13:28, Daniel de Oliveira Mantovani
>> <daniel.oliveira.mantovani em gmail.com> wrote:
>> > Que eu saiba tem que retornar a saída que o blabos pois:
>> > merge('abc', 12345) -> a1b2c345
>> >
>> > Ele não diz que a saída é uma string.
>> >
>> > Pelo que eu entendi tem que aparecer isso no terminal:
>> > a1b2c345
>> >
>> > 2010/2/4 Fernando Oliveira <fernandocorrea em gmail.com>:
>> >> Mantovani, claro q precisa! Isso nao ta retornando uma string...
>> >>
>> >> On Feb 4, 2010 12:59 PM, "Daniel de Oliveira Mantovani"
>> >> <daniel.oliveira.mantovani em gmail.com> wrote:
>> >>
>> >> Não precisa do join:
>> >> sub merge{@b=split//,pop;@a=split//,pop;map{$a[$_].$b[$_]}0.. em a+@b}
>> >>
>> >> mantovani em mantovani-desktop:~$ perl -MMerge -E 'say merge("dan",12)'
>> >> d1a2n
>> >>
>> >>
>> >> 2010/2/4 breno <breno em rio.pm.org>:
>> >>> e -2 tirando parenteses
>> >>>
>> >>> sub merge{@b=split//,pop;@a=split...
>> >>
>> >> --
>> >> "If you’ve never written anything thoughtful, then you’ve never had
>> >> any difficult, important, or interesting thoughts. That’s the secret:
>> >> people who don’t write, are people who don’t think."
>> >>
>> >> _______________________________________________
>> >> Rio-pm mailing list
>> >> Rio-pm em pm.org
>> >> http://mail.pm.org...
>> >>
>> >> _______________________________________________
>> >> Rio-pm mailing list
>> >> Rio-pm em pm.org
>> >> http://mail.pm.org/mailman/listinfo/rio-pm
>> >>
>> >
>> >
>> >
>> > --
>> > "If you’ve never written anything thoughtful, then you’ve never had
>> > any difficult, important, or interesting thoughts. That’s the secret:
>> > people who don’t write, are people who don’t think."
>> >
>>
>>
>>
>> --
>> "If you’ve never written anything thoughtful, then you’ve never had
>> any difficult, important, or interesting thoughts. That’s the secret:
>> people who don’t write, are people who don’t think."
>> _______________________________________________
>> Rio-pm mailing list
>> Rio-pm em pm.org
>> http://mail.pm.org/mailman/listinfo/rio-pm
>>
>
>
> _______________________________________________
> Rio-pm mailing list
> Rio-pm em pm.org
> http://mail.pm.org/mailman/listinfo/rio-pm
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/rio-pm/attachments/20100204/6b65e969/attachment-0001.html>


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