Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 contemplating the Monastery: (7)
As of 2015-07-07 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls