Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Polynomial JAPH (golf?)

by ambrus (Abbot)
on Oct 12, 2006 at 15:27 UTC ( #577876=note: print w/ replies, xml ) Need Help??


in reply to Re: Polynomial JAPH (golf?)
in thread Polynomial JAPH

As for other mathematical ways, you can use some variants of the Fourier transformation. My Fast Japh does that, for example. It's called "fast" because for long strings it would be much faster to do than the simple polynomial thing.

Now, as is, that japh encodes and decodes the string again so it's not much useful, but I've converted it to a japh that does the decoding only:

use warnings; use strict; @,="-34-7-76+39-90+35-38-253-8+111-6+113-90-97-134+263+-4-49+38-75-6 -69-10+263+90+49+88+67-26-133-38+1271"=~/.\d+/g;for$,(0..4){2**$,&$_ or$,[uc]+=$,[2**$,+$_]-=($,[lc]*=2)/2for 0..31}print chr($_/16)for@, +

Update: fixed code, which accidentally had its output appended to it.


Comment on Re^2: Polynomial JAPH (golf?)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-12-18 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (42 votes), past polls