Oooh! Pretty! That's a fractal right? What's it called?

use strict; use Tk; my $phi = 0; my $thisX = 185; my $thisY = 500; my $nextX = 185; my $nextY = 500; my $mw = MainWindow->new; $mw->geometry( "700x700" ); my $c1 = $mw->Canvas( -background => 'black', -height => 700, -width => 700) ->pack; use constant PRINT => 'P'; use constant LEFT => '<'; use constant RIGHT => '>'; my $ax = "P>" x 4 . "P"; $ax =~ s/P/P<P>P>P<P/g for 1 .. 4; for (split //, $ax) { if ($_ eq RIGHT) { # rotate right $phi += 90; $phi -= 360 if $phi >= 360; } elsif ($_ eq LEFT) { # rotate left $phi -= 90; $phi += 360 if $phi < 0; } elsif ($_ eq PRINT) { # print $thisX = $nextX; $thisY = $nextY; if ($phi == 0) { $nextX += 4 } elsif ($phi == 90) { $nextY -= 4 } elsif ($phi == 180) { $nextX -= 4 } elsif ($phi == 270) { $nextY += 4 } $c1->createLine( $thisX, $thisY, $nextX, $nextY, -fill => 'white' ); $mw->update; } } $c1->createText( 350, 350, -text => "P E R L \n M O N K S", -fill => 'white', -width => 300); MainLoop;
__SIG__ printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;

In reply to Re: Order Out Of Chaos by diotalevi
in thread Order Out Of Chaos by Lysander

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.