#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
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Beauty of Perl
by MeowChow (Vicar) on Mar 28, 2001 at 11:09 UTC | |
by dmckee (Scribe) on Mar 28, 2001 at 22:49 UTC | |
by MeowChow (Vicar) on Mar 28, 2001 at 23:07 UTC | |
by dmckee (Scribe) on Mar 30, 2001 at 14:28 UTC |