Mandelbrot One-liner
WaiKin Wong sent me a Mandelbrot one-liner:
$i=$j=$r=$x=$y=[float]-16; while(($y++) -lt 15) {for($x=0; ($x++) -lt 84; write-host (" .:-;!/>`)|&IH%*#"[$k -band 15]) -nonewline){$i=$k=$r=[float]0;do{$j=$r*$r-$i*$i-2+$x/25;$i=2*$r*$i+$y/10;$r=$j} while (($j*$j+$i*$i) -lt 11 -band ($k++) -lt 111)}" "}
This produces the following results:
:::::::::::::------------------------------------------------:::::::::::::::::::::::
:::::::::--------------------------------------------------------:::::::::::::::::::
:::::----------------------------------;;;;;;;;;;;-------------------:::::::::::::::
:::-----------------------------;;;;;;;;;;;;;;;;;;;;;;;;---------------:::::::::::::
---------------------------;;;;;;;;;;;;;!!!/-%//!!!;;;;;;;;---------------::::::::::
------------------------;;;;;;;;;;;;;!!!!//>)I#&H /!!!;;;;;;;;--------------::::::::
--------------------;;;;;;;;;;;;;!!!!!!//>)|&:# &)>//!!!!;;;;;;;--------------::::::
----------------;;;;;;;;;;;;;!!!!!!////>>)&- /-&>>///!!!!;;;;;--------------:::::
------------;;;;;;;;;;;;!!!!!!!//>)|H))|&&H %I||)>>>>#/!!;;;;;-------------::::
--------;;;;;;;;;;!!!!!!!!!!///>>|%- & .H%I#H >!!;;;;;-------------:::
-----;;;;;;;;;!!!!///////////>>)&:%- H)>/!!;;;;;-------------::
-;;;;;;;;;;!!!!/>&&)>>))))>>))|&*. *&I>/!!;;;;--------------:
;;;;;;;;!!!!!//>>|I.-!H#;% I&&I> #|>/!!;;;;;--------------
;;;;;!!!!!///>>)|H%-; I//!!;;;;;--------------
!!!!/////>>>)|%*:## # |>/!!!;;;;;;-------------
.I|>//!!!;;;;;;-------------
!!!!/////>>>)|%*:## # |>/!!!;;;;;;-------------
;;;;;!!!!!///>>)|H%-; I//!!;;;;;--------------
;;;;;;;;!!!!!//>>|I.-!H#;% I&&I> #|>/!!;;;;;--------------
-;;;;;;;;;;!!!!/>&&)>>))))>>))|&*. *&I>/!!;;;;--------------:
-----;;;;;;;;;!!!!///////////>>)&:%- H)>/!!;;;;;-------------::
--------;;;;;;;;;;!!!!!!!!!!///>>|%- & .H%I#H >!!;;;;;-------------:::
------------;;;;;;;;;;;;!!!!!!!//>)|H))|&&H %I||)>>>>#/!!;;;;;-------------::::
----------------;;;;;;;;;;;;;!!!!!!////>>)&- /-&>>///!!!!;;;;;--------------:::::
--------------------;;;;;;;;;;;;;!!!!!!//>)|&:# &)>//!!!!;;;;;;;--------------::::::
------------------------;;;;;;;;;;;;;!!!!//>)I#&H /!!!;;;;;;;;--------------::::::::
---------------------------;;;;;;;;;;;;;!!!/-%//!!!;;;;;;;;---------------::::::::::
:::-----------------------------;;;;;;;;;;;;;;;;;;;;;;;;---------------:::::::::::::
:::::----------------------------------;;;;;;;;;;;-------------------:::::::::::::::
:::::::::--------------------------------------------------------:::::::::::::::::::
:::::::::::::------------------------------------------------:::::::::::::::::::::::
Thanks for sharing WaiKin!
Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx