in reply to Polynomial JAPH

This is really neat, I haven't seen this approach to a japh before. A nice demonstration of a novel way to encode the text.
If you are golfing, here's a (very) slight reduction:
for('3.55*$i**5-57.583*$i**4+347.75*$i**3-972.92*$i**2+1249.2*$i-463.5 +','-0.55*$i**5+10.208*$i**4-69.833*$i**3+215.29*$i**2-292.12*$i+247.5 +','1.25*$i**5-25.333*$i**4+191.25*$i**3-672.17*$i**2+1099*$i-561.5',' +0.5833*$i**5-9.4583*$i**4+56.167*$i**3-148.54*$i**2+169.25*$i+36.5'){ +for$i(1..6){print chr eval}};
Makes me wonder about other mathematical ways of encoding the text, maybe as solutions to other kinds of equations or as fixed points of some system...
~dewey

Replies are listed 'Best First'.
Re^2: Polynomial JAPH (golf?)
by ambrus (Abbot) on Oct 12, 2006 at 15:27 UTC

    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.

Re^2: Polynomial JAPH (golf?)
by tweetiepooh (Hermit) on Oct 12, 2006 at 10:01 UTC
    Thankyou.

    Excel seems limited to 6 orders of polynomial (or whatever) and the coding seems to break down if the text is longer than that. Maybe those who are in the know could get an equation that would work on longer strings, all 24 chars in JAPH, then you may have one equation called 24 times.

    while(++$1<25){print chr "<equation>"}
    A weakness may be in how computer handles numbers with rounding etc.