Just for fun, I decided to write a JAPH that satisfied the following constraints:
1) No strings*.
2) The digits 0-9 cannot appear in the code.
3) No reserved words/core functions over 3 characters long.
4) Letters can only appear in lower-case reserved words and core functions.
5) The letters J, A, P, and H cannot appear in the code in upper- or lower-case.
6) Each letter must be generated in a different way.
7) No variable can be used more than 4 times.
8) The final code must be less than 120 chars.
The result (wrapped to fit in 80-char lines)**:
\_=~/..(.)/;$^=$_=$+;y/+-~/:-~/;$^++for($$/$$<<$#+..ord$/);
vec($@=$^,$%,$#**$@+$#+)=$!;die$^.$+.$_.$@.$/
Now here's the challenge:
Prove or disprove that it is possible to write a JAPH (in Perl) that satisfies the constraints listed above and works on both ASCII and EBCDIC systems.
Have fun ;-).
*You are allowed to have regexes (qr//, m//, etc.), but qw, qq, q, s/// without the 'e' modifier, here documents, etc. are not allowed.
**Yes, I know that this can be further reduced (it's not even very obfuscated!). How short/further obfuscated can you make it (while still meeting the constraints)?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.