Re: Fun - Each character at most once
Adam Rice <[email protected]>
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
Quoting A. Pagaltzis ([email protected]): > Basically, with all ASCII characters used at most once, you can't > really write anything that needs to actually operate on data in > any more but the most trivial ways. Actually, using the technique from Ronald J Kimball's JAPH, you can encode any ASCII Perl program less than about 36 characters. Here's a really boring example: s{}[ !"#%B&-'*EAHCJIONLR.4VU0],$_^=q<PSKMQbGYFDwixojd~gprZtn:>;eval I wrote a program to generate these, but has an unfun tendency to take forever when the solution is non-trivial so I won't post it. If there was a better technique than brute force to find the answers that might be fun, but I just can't get my head around it. If you allow the full-range of 8-bit characters, rather than just ASCII, you can encode much longer programs, up to 120 characters or so, definitely enough to do non-trivial computation. Adam -- Adam Rice -- [email protected] -- Blackburn, Lancashire, England