Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

bzip your JaPH today!

by ariels (Curate)
on Feb 27, 2002 at 14:09 UTC ( #147901=obfuscated: print w/ replies, xml ) Need Help??

We theoreticians always claim it's worth expending extra effort to find the best algorithm for the task. As you can see, the program itself is entirely straightforward Perl.
#!/usr/local/bin/perl -w use strict; my$t=",rtlr\n h ahkP tcraneeeusoJ"; my$s=join'',sort split//,$t; my(@t); while ($s=~/(.)\1*/sg){my$l=$1;push@t,(pos$t)-1 while$t=~/$l/g} my$i=0;print map{substr($s,$i=$t[$i],1)}(1..@t)

Comment on bzip your JaPH today!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-07-26 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls