#!/usr/bin/perl -w $:='un';use strict;$; # always use strict and -w =1;$~='ken';use Tk;$^='its';$= # cool! He put POD in an obfu =1+$;;$"=$=*$=*0113;$-=0661;$.= # again! again! MainWindow->new();$/=$.->Canvas # You can't do that! (-relief=>'s'.$:.$~,-bd=>$=,-width # Say what? =>$=*$",-height=>$=*$");$\='JAPH'; # It has a JAPH too! $/->yviewScroll($-,$:.$^);sub _{ # mkay.... $/->createLine(@_)}$/->xviewScroll # you are an odd one ($-,$:.$^);for$,($;..$"){;$%=$"- # lots and $,;_($,,$;,$;,$%);_($,,$;,$;,-$%); # lots of _(-$,,$;,$;,$%);_(-$,,$;,$;,-$%);_ # beautiful ($",$,,$%,$");_($",-$,,$%,-$");_(- # punctuation $",$,,-$%,$");_(-$",-$,,-$%,-$");} # marks! $/->pack;MainLoop; # Love it!

Replies are listed 'Best First'.
Re: Tiptoe through the punctuation
by jonadab (Parson) on Mar 09, 2003 at 01:52 UTC

    Some interesting stuff. You're not fooling me with the comments, but you get ++ for assigning to some special variables I've never managed to find an excuse for assigning to.

    I think I have a fair idea what it does, though, even though I don't use Tk myself except a couple of times a while ago.

    And what is it with subs named _? Two of 'em in a row today, sheesh.

    Oh, and on a personal note, cool home node. Wouldn't have replied just to say that, but since I was anyway...


    for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}

      It has been suggested that I deobfuscate it...

      So it draws a regular pattern of crisscrossing lines. [runs it to see] close enough together that it looks like solid areas. We've all plotted this in junior high math, but usually on quarter-inch graph paper with one vertex each square; it looks quite different with directly adjascent vertices like this. The first four draw the inside shape, and the last four calls to _ draw the frame.


      for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}

        Well done!

        $. is also known as $INPUT_LINE_NUMBER and is to be considered read-only. It is undefined until you read from a filehandle or it is assigned to by your program. If you assign a value to $. and then read from a filehandle, it will be reset to its proper value by Perl.

        Example:

        #!/usr/bin/perl -w use strict; print "\$. is ", $., $/; $. = 9999; print "\$. is now ", $., $/; print "Press <enter> to continue.\n"; my $input = <>; print "\$. is now ", $., $/;

        Oh, and it's a bummer having the parens around the args on all the calls to _. It would have been much harder to read otherwise. Think in terms of...

        _$ ,,$;,$;,$%;_$,,$;,$;,-$%;_-$,,$;,$;,$%;_-$,,$;,$;,-$ %;_$",$,,$%,$";_$",-$,,$%,-$";_-$",$,,-$%,$";_-$",-$ ,,-$%,-$"

        But that spits syntax errors. So sad ;-)


        for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}