Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
A for-loop is usually shorter than a do{...}while-loop. 70 :-) $t=abs$ARGV[1]+$_,print$/,map{(sort$t,abs$ARGV[0]-$_)[1]}1..9for-9..-1If you want the newlines "right", I end up at 72: $t=abs$ARGV[1]+$_,print map((sort$t,abs$ARGV[0]-$_)[1],1..9),$/for-9..-1Update: Well, what do you know ... the string $ARGV[1]+$_ is longer than the strings ($s=pop) and $s taken together. Make those 69 and 71 (both with tie-breaker at 30 different characters): $t=abs,print$/,map+(sort$t,abs$ARGV[0]-$_)[1],1..9for($s=pop)-9..$s-1... and ... $t=abs,print map((sort$t,abs$ARGV[0]-$_)[1],1..9),$/for($s=pop)-9..$s-1The Sidhekin In reply to Re: Re: ASCII Pattern - Golf (The Sidhekin: 70, or no, 69)
by Sidhekin
|
|