[CrackMonkey] DAPQOTD

Paul Cameron 1paul at optushome.com.au
Fri Apr 20 02:41:03 PDT 2001

On Fri, Apr 20, 2001 at 04:11:40AM -0500, Ben Brockert wrote:
> In today's episode of 'Somebody Buy Ben the Camel Book Already', we see
> that he yet again can't figure out how to do a relatively trivial task.
> Today's trivial task is to take an integer and encode that number as an
> ascii string. Here are sample desired results:
> input  output  idea
> 66     B       ascii 66 is B
> 8784   "r      ascii 8784-(8784%255) is " ascii 8784%255 is r
> 41646  ?Q      ascii 41646-(41646%255) is ? ascii 41646%255 is Q
> So pretty much all Ben needs to know is how to print an ascii character
> by it's number, which is incredibly simple and Ben is unusually ashamed
> to be asking such a DAPQ. Please flame as necessary, maybe then Ben will learn.

Dunno. Maybe:

$num = 8784;
($a = chr($num%255) . $a), $num /= 256 while $num;

Who cares, really. MS doesn't certify Perl, so what use is it? And if it's
so good at text processing, why did Java get unicode support first?



More information about the Crackmonkey mailing list