in reply to Animated Fractal Tree
For them that like large terminals:
Runs much slower though... a steadier wind perhaps? :)#!/usr/bin/perl -w use strict; while(1){$:=' 'x2E3;$a+=.01;$b+=.03;$~=(sin$a+sin$b)/10+.2;system( ($^O eq 'MSWin32')?'cls':'clear');t(40.5,0,-11/7);my @rows=split( //,$:);my $i=0;for(@rows){print $_;if($i eq 80){print "\n";$i=0;}$ i++;}}sub t{my($x,$y,$d,$D)=@_;($x,$y)=l($x,$y,$d,11/++$D);$D<4|| return;t($x,$y,$d-.6-$~*$d,$D);t($x,$y,$d+.6-$~*$d,$D--)}sub l{my( $x,$y)=@_;for(0..pop) {p($x+=cos$_[2],$y+=sin$_[2])}($x,$y)}sub p{ substr($:,int(pop)*80+int(pop),1)='#'}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Animated Fractal Tree
by reasonablekeith (Deacon) on May 26, 2005 at 16:28 UTC |