2 # Mandelbrot set ASCII visualisation
3 # http://en.wikipedia.org/wiki/Mandelbrot_set
4 # Copylefted by: Harvie 2oo9
23 # ba aaaak c c kaaaa ab
29 # aaa ab aa afa afa aa ba aaa
35 #my @chars=split(//, ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890');
36 #my @chars=split(//, ' .-:*+=%@#');
37 my @chars=split(//, ' .`-_\':,;^=+/\"|)\\<>)iv%xclrs{*}I?!][1taeo7zjLunT#JCwfy325Fp6mqSghVd4EgXPGZbYkOA&8U$@KHDBWNMR0Q');
39 my $max_iteration = 140;
42 for($max_iteration=0;$max_iteration<1000;$max_iteration++) {
45 print "ASCII Mandelbrot Set Visualisation (Harvie 2oo9) - Iterations: $max_iteration \n";
46 #for(my $x=-1;$x<=1.1;$x+=0.1) { for(my $y=-2;$y<=1;$y+=0.04) {
47 for(my $i=-2;$i<=2;$i+=5/$zoom) { for(my $j=-2.1;$j<=2.1;$j+=2/$zoom) {
57 while ( $x*$x + $y*$y <= (2*2) && $iteration < $max_iteration ) {
58 my $xtemp = $x*$x - $y*$y + $x0;
65 if ( $iteration == $max_iteration ) {
68 $color = int( (($iteration/$max_iteration)*@chars) + .5);
This page took 0.274936 seconds and 4 git commands to generate.