Mandelbrot Set


posted by Tobias Weltner
11-01-2008

Downloads: 328
File size: 487 B
Views: 1,113

Embed
Mandelbrot Set
  1. $i=$j=$r=$x=$y=[float]-16;  
  2. $colors="Black","DarkBlue","DarkGreen","DarkCyan","DarkRed","DarkMagenta","DarkYellow","Gray","DarkGray","Blue","Green","Cyan","Red","Magenta","Yellow","White" 
  3. while(($y++) -lt 15) { 
  4.     for($x=0; ($x++) -lt 84;  
  5.         write-host " " -backgroundcolor ($colors[$k -band 15]) -nonewline) { 
  6.         $i=$k=$r=[float]0; 
  7.         do{$j=$r*$r-$i*$i-2+$x/25;$i=2*$r*$i+$y/10;$r=$j}  
  8.         while (($j*$j+$i*$i) -lt 11 -band ($k++) -lt 111) 
  9.     
  10.     " " 
Filed under:
creates a Mandelbrot Set and demos simple graphical capabilities
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.