Pathologically Eclectic Rubbish Lister PerlMonks

### ASCII arithmetic

by martin (Friar)
 on Sep 29, 2010 at 10:16 UTC Need Help??

```\$%=2,\$"=6;\$;=ord"\c?";print+map{\$%*="@_[4,4,
]";\$=-=\$=;\$=*=\$%%=\$;,\$=+=ord,\$=%=\$;for@_;chr
\$=}@_=split?,*?,q=|f475!%L(wz)Hmqkcz?ar~x<m=
[download]```

This one won't work correctly on an EBCDIC machine, I am afraid. But you can turn on strictures and warnings if you like.

Replies are listed 'Best First'.
Re: ASCII arithmetic
by hbm (Hermit) on Sep 29, 2010 at 18:41 UTC
Re: ASCII arithmetic
by ambrus (Abbot) on Sep 29, 2010 at 15:19 UTC

Beautiful. This is the best take so far on the kind of japhs

that contain the coefficient of a polynomial which has to be evaluated to get the message. This one contains two extra twists: firstly the variable substituted is not adjacent integers, secondly you use punctuation variables in such a confusing manner that it's not at all obvious which variable is used for its original special purpose.

The truly beautiful thing is how there are no control characters in the string encoding the coefficients (and it's even one character shorter than it should be). I don't understand how you did that, because if I try to modify this japh, then the string I get is full of control characters, making the code much longer:

```\$%=2,\$"=6;\$;=ord"\c?";print+map{\$%*="57 @_[4
]";\$=-=\$=;\$=*=\$%%=\$;,\$=+=ord,\$=%=\$;for@_;chr
\$=}@_=split//,"'QV\bjC\cu-\am\cy\cr#i\"HHuM\cb`w,\t_4"
[download]```
(Sorry for the way I messed up the string at the end of the first line, I don't have patience to fix that now.)

Update: striked out the part about the polynomial being too short, that's my mistake.

Log In?
 Username: Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://862574]
Approved by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2018-04-26 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My travels bear the most uncanny semblance to ...

Results (97 votes). Check out past polls.

Notices?