Re: Break the 65 chars :-)

Jose Alves de Castro <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
OK... Greg has just introduced me to some "Normal etiquette" (and also
to the "International" perl golf counting method)...

I apologize for not having submited my solution so far; the only reason
why I didn't do it was because I thought you might want to give it a try
without being influenced.

Here it goes:

#!/usr/bin/perl -l0n
/:/;$_{$'.$&}.=" $`,"}{map{s/,$/
/;print}%_

:-)

jac

On Mon, 2004-04-26 at 15:54, Jose Alves de Castro wrote:
> Try to do this in the least amount of characters possible :-)
> 
> Sample Input:
> 
> root:admins
> administrator:admins
> me:users
> 
> Output:
> 
> admins: root, administrator
> users: me
> 
> My current solution is now on 65 bytes (that's the size of the whole
> script), but I guess more experienced golfers than me will probably
> manage to do something smaller... :-)
> 
> Happy hacking ;-)
> 
> jac
-- 
José Alves de Castro <[email protected]>
Telbit - Tecnologias de Informação
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.