[ot] Perl (was: ASCII art from sourcecode as image)
Arthur J. O'Dwyer wrote: > > On Thu, 17 Jul 2003, Harry Mason wrote: >> >> Arthur J. O'Dwyer wrote: >> > On Wed, 16 Jul 2003, Harry Mason wrote: >> >> #!/usr/bin/perl -w >> >> eval eval '"'. ('#'). >> >> '!'.'/' .('[' >> ><snip most of very nice program> >> > >> > The OP has told me via e-mail that he really wants Java, of course. >> > So unfortunately the 'eval big_long_string' trick that I think is >> > at the root of EyeDrops' approach wouldn't work. >> >> Bear in mind that this is actually an obfuscator, not just a reformatter. >> You could achieve a similar effect in most languages, including Java, by >> creative use of white space, string concatenation, etc. > > Certainly not in C or C++, and not in the vanilla beginner's Java I'm > familiar with. They don't have any equivalent of "eval", unless you > build your own interpreter on top of everything. :) Even without eval(), you can still rename variables, concatenate strings, and insert comments. import java.io.PrintStream; public class ASmileyFace { public static void main(String[] a) { PrintStream out = System.out ; out.print( "This" + " is " + "both a " + "reform"+ "atted J" + "av" + "a prog"+ "ram, an" + "d a sm"+ "i".concat( "ley " + "face. Th"+ "is " + "shows how to " + "f"+ "orm" + "at Jav" + "a "+ "usi" +"n"+ "g whitespace only.") ) ;} } As for C, I expect you can find some examples at the IOCCC: http://www.ioccc.org/ >> > And what does ('['^'.') mean? 0x5B^0x2E = 0x75 = 'u', or is there some >> > deeper magic at work here? :) >> >> ('['^'.') corresponds to the "u" in "use strict". Obfuscating is so much more >> effective if you don't use any alphanumerics in your source code. :) > > Yeah - but does Perl specify ASCII? And in a language where x is an > operator, I wasn't sure but that ^ meant something even weirder for > strings... It's just doing bitwise XOR on the ASCII values of each character. See the section "Bitwise String Operators" in perlop(1). Perl source code is ASCII unless you add "use utf8;"; then it can be UTF-8 - but doing bitwise operations on UTF-8 strings will no doubt get you into trouble one day. :) -- | Harry Mason | .------------. | .___, |"Whatever you do will be | | University of | | hjm200 @ | | ___('v')___ | insignificant. However, | | Southampton | | zepler.net | | `"-\._./-"' | it is vitally important | | England | '------------' | hjm ^ ^ | that you do it." Gandhi |
Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,fd4f3d79f18d7426 X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2003-07-18 01:12:41 PST Newsgroups: alt.ascii-art From: Harry Mason <spa...@no.spam> Subject: [ot] Perl (was: ASCII art from sourcecode as image) References: <bf1lt6$c6r$03$1...@news.t-online.com> <slr...@tarrant.ecs.soton.ac.uk> <Pin...@unix50.andrew.cmu.edu> <slr...@prodigy.ecs.soton.ac.uk> <Pin...@unix46.andrew.cmu.edu> Message-ID: <slr...@tarrant.ecs.soton.ac.uk> User-Agent: slrn/0.9.7.4 (Linux) NNTP-Posting-Host: tarrant.ecs.soton.ac.uk Date: 18 Jul 2003 08:59:58 GMT X-Trace: 18 Jul 2003 08:59:58 GMT, tarrant.ecs.soton.ac.uk Lines: 65 Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!skynet.be!skynet.be!peer.news.eu-x.com!server2.netnews.ja.net!news-spool.soton.ac.uk!news.ecs.soton.ac.uk!tarrant.ecs.soton.ac.uk Xref: archiver1.google.com alt.ascii-art:24264
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
\\__ o
|\/ o\ o
> < o
|/\ __/
// |\__/,| (`\ |_ _ |.--.) ) ( T ) / (((^_(((/(((_/
, _ , ( o o ) /'` ' `'\ |'''''''| |\\'''//| """
,~~--~~-. + | |\ || |~ |`,/-\ *\_) \_) `-'
__
\ \ _ _
\**\ ___\/ \
X*#####*+^^\_\
o/\ \
\__\ .------------. |\\//\\//\\//| |//\\//\\//\\| |\\//\\//\\//| |//\\//\\//\\| '------------'
Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this message.
This message was posted publicly to the newsgroup
alt.ascii-art
in 2003 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.
Report this message
Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.