Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: GOLF: Input sort list of integers, Output as [356853]

by EvdB (Deacon)
on May 27, 2004 at 14:48 UTC ( #356922=note: print w/ replies, xml ) Need Help??


in reply to GOLF: Input sort list of integers, Output as [356853]

After much fun down to 44.

# 1 2 3 4 5 #1234567890123456789012345678901234567890123456789012345678 #map{$j=0 if$l!=$_&&print'';print++$i.") $_-".++$j;$l=$_}@_ #map{print$j=''if$l!=$_;print++$i.") $_-".++$j;$l=$_}@_ #map{print''if!$A{$_};print++$i.") $_-".++$A{$_}}@_ print$A{$_}?'':$/,++$i.") $_-".++$A{$_}for@_
Update 1: Now down to 43:
print!$A{$_}&&$/,++$i.") $_-".++$A{$_}for@_
Update 2: Now down to 42:
print!$A{$_}++&&$/,++$i.") $_-$A{$_}"for@_
Update 3: Now 41 (Inspired by Abigail-II):
print$/x!$A{$_}++,++$i.") $_-$A{$_}"for@_

--tidiness is the memory loss of environmental mnemonics


Comment on Re: GOLF: Input sort list of integers, Output as [356853]
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://356922]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-10-01 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (392 votes), past polls