When would you get an ant, a spider, a man o' war, Martin, Halley, Julia, Lorenz, Lyapunov, Newton and the Gingerbread Man all in a frothy basin?
#perl -w use strict; ######################################### # # # bop.pl # # Beauty of Perl # # # # suggested use: # # perl bop.pl 70 20 for a console # # perl bop.pl 1000 1000 for a textfile. # # # ######################################### my ($martin,$manowar,$kamtorus, $hypercomplex,$unity,$ant,$spider)=@ARGV; unless (defined $manowar) {($martin,$manowar)=(70,20)}; unless (defined $ant) {($kamtorus,$ant,$unity,$hypercomplex)=(-2,1.5,1,-1.5)}; $spider=50 unless $spider; my $frothybasin="X.'-;/?71ICDOQ\@M"; for (1..$manowar) { my $halley=$hypercomplex+$_*($ant-$hypercomplex)/$manowar; for (1..$martin) { my $julia=$kamtorus+$_*($unity-$kamtorus)/$martin; my ($lsystem,$lorenz,$lyapunov,$newton,$gingerbreadman)=(' ',$hall +ey,$julia); for (1..$spider) { $newton=$halley+$lyapunov*$lorenz+$lorenz*$lyapunov; $gingerbreadman=$lyapunov*$lyapunov+$julia-$lorenz*$lorenz; ($lorenz,$lyapunov)=($newton,$gingerbreadman); if ($lorenz*$lorenz+$lyapunov*$lyapunov>4) {$lsystem=substr($frothybasin,$_%length($frothybasin)-1,1);} last unless ($lsystem eq ' '); } print $lsystem; } print "\n"; }

Dave

Eight years involved with the nuclear industry have taught me that when nothing can possible go wrong and every avenue has been covered, then is the time to buy a house on the next continent. Terry Pratchett


In reply to Beauty of Perl by dmckee

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.