in reply to Re: Tiptoe through the punctuation
in thread Tiptoe through the punctuation

It has been suggested that I deobfuscate it...

#!/usr/bin/perl -w $:='un'; # Not using format: this is just a variable. use strict; # No multidimensional arrays either, so $;=1; # this is also just a variable. $~='ken'; # Another variable (since not using format). use Tk; $^='its'; # Another variable. (format again) $==1+$;; # And another, set to 2. $"=$=*$=*0113; # =300. $-=0661; # =433. $.=MainWindow->new(); # I didn't know you could assign $. $/=$.->Canvas( # Changes how <FOO> behaves (but we # don't use that operator here anyway). -relief=>'s'.$:.$~, # sunken -bd=>$=, # some window prop =2. -width=>$=*$", # Window is 600 -height=>$=*$" # pixels square. ); $\='JAPH'; # This will be printed after any print, # but there are no prints, more's the pity. $/->yviewScroll($-,$:.$^); # Scrolls 433 units? # I don't know enough Tk to know exactly. sub _{$/->createLine(@_)} # All the calls below apparently create lines. $/->xviewScroll($-,$:.$^); # Scrolls horizontally? # Again, my knowledge of Tk is lacking. 433 units # worth of something, in any case. for$,($;..$"){# foreach $, (1..300) { ; # do_nothing(); $%=$"-$,; # we have n and 300-n ($, and $%) _($,,$;,$;,$%); # line(( n , 1)to( 1 ,300-n)) _($,,$;,$;,-$%); # line(( n , 1)to( 1 ,n-300)) _(-$,,$;,$;,$%); # line(( -n , 1)to( 1 ,300-n)) _(-$,,$;,$;,-$%);# line(( 300, n)to( 1 ,n-300)) _($",$,,$%,$"); # line(( 300, n)to(300-n, 300 )) _($",-$,,$%,-$");# line(( 300,-n)to(300-n,-300 )) _(-$",$,,-$%,$");# line((-300, n)to(n-300, 300 )) _(-$",-$,,-$%,-$");#line((-300,-n)to(n-300,-300 )) } $/->pack;MainLoop; # I know just enough Tk to know this displays it all.

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$/}

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

    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$/}
$. explained
by Mr. Muskrat (Canon) on Mar 11, 2003 at 17:40 UTC

    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 ", $., $/;

      Almost correct.

      You can motify $. but you first have to have it pointing to the correct file handle:

      print "($.)\n"; # undefined $. = 10; print "($.)\n"; # 10, but for which file handle? print "ENTER: "; ''.<STDIN>; print "($.)\n"; # 1, for STDIN $. += 10; print "($.)\n"; # 11, still for STDIN print "ENTER: "; ''.<STDIN>; print "($.)\n"; # 12, not 2 !

                      - tye