Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Challenge: Nearest Palindromic Number

by BrowserUk (Patriarch)
on Feb 03, 2005 at 09:10 UTC ( [id://427561]=note: print w/replies, xml ) Need Help??


in reply to Challenge: Nearest Palindromic Number

You said you'd consider an obfu if it worked? It takes a somewhat different approach too.

local$/;use Compress::Zlib;use List::Util qw[ reduce ];;;;;; $_=reduce{ref$a?$a:$a+$b<=$ARGV[0]?($a+=$b):[$a,$a+$b];;;;;; }unpack'U0xU*',Compress::Zlib::memGunzip(unpack'u*',<DATA>); print $ARGV[0]-$_->[0]<=$_->[1]-$ARGV[0]?$_->[0]:$_->[1];;;; __DATA__ M'XL(```````""^W8P:V"4!`%T#!+IDW7KQ(6%F`!)C9`%X86J$06O@V1W=/X MPD$6Q/F)W,--F/QAJ$?D^XBQ'MGX*DH]LO%57.I1OG:5?L-O^(W#JUBF_:?T M\U6Z>W?O[MV]NS_%W<?SOO\L4W_?%3'$$$,,,<0X7XST-,000PPQQ!##6]S3 M$$,,,<000PQO<:420PPQQ!!##&]Q,<000PPQQ/`6]S3$$$,,,<00PUO<TQ!# M##'$$$,,;W&E$D,,,<00PUO<TQ!###'$$$.,+F/$^IB/SF4RG`L#0(```0($ M"!`@0)_.9*!!@``!`@0($"!`@&S2&@0($"!`@``!`@3()JU!@``!,@0$"!`@ M0#9I#0($"!`@0(```0)DD]8@0(```0($"!`@0(8V:0T"!`@0($"```$"9)/6 M($"```$"!`@0($`V:0T"!`@0($"```$"]-?#6&_7PW/["]-Z;HPP4*%"A0H5 M*E2H4/UR6E@H%2I4J%"A0H4*%2K+NE*A0H4*%2I4J%"9HK*L*Q4J5*A0P4"% M"A4JR[I2H4*%"A4J5*A,4:&RK"L5*E2H8*!"A0H5*LLZ*:5"A0H5*E2FJ%"A MLJPK%2I4,%"A0H4*%2I4EG6E0H4*%2I4J%"A0F595RI4,%"A0H4*%2I4J%I, MDX52H4*%"A4J5*A0H?*?=:5"A0H5*E2H4*$R16595RI4J%"A@H$*%2I4EG6E M0H4*%2I4J%"9HD)E65<J5*A0P4"%"A4J5)9U4DJ%"A4J5*A,4:%"95E7*E2H 38*!"A0H5JF;3\06.=,S9-'L!````

Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found