Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi all,
this is my very first post here. I'd like to talk about my latest japh. My previous attempts had concentrated on either code or data obfuscation by means of tons of stuff like q* constructs with strange delimiters, eval(), and so on. For this particular one instead I had a precise algorithm in mind. Eventually it turned out to be more of a golfing exercise than an obfuscation one. All in all there's no obfuscation at all and not much data obfuscation either, in the sense that it is clear to see *where* it is stored. Still IMHO it's not so easy to understand *what* the algorithm does and *why* it works. Here it is: Note that it's not a japh in the strictest sense, i.e. it doesn't simply print() "Just another Perl hacker,\n". Also, the effect it achieves is manifest under xterms and at *DOS prompt, whereas Linux console, even with $|==1 is too fast for it. A variant in which I slow it down by making it do a "few" unnecessary operations is
Despite what some people think about this kind of exercises, it turned out to be very instructive.
For example the first versions of this japh were so verbose that I didn't hope it would have been possible to shrink it to fit in .sig's standards. A big improvement was obtained when I realized that I didn't need to work with strings of "\0" and "\01" as I had initially assumed, but that any two chars would do instead. This is obvious if you think about the possible outcome of an expression of the kind a*b*c where * is a binary operation "of the kind of XOR" and a,b, and c can take two values only. But it was not so obvious until I stopped to think about it... In reply to My 1st post (japh) by blazar
|
|