2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
20
Task/Mandelbrot-set/PowerShell/mandelbrot-set.psh
Normal file
20
Task/Mandelbrot-set/PowerShell/mandelbrot-set.psh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
$x = $y = $i = $j = $r = -16
|
||||
$colors = [Enum]::GetValues([System.ConsoleColor])
|
||||
|
||||
while(($y++) -lt 15)
|
||||
{
|
||||
for($x=0; ($x++) -lt 84; Write-Host " " -BackgroundColor ($colors[$k -band 15]) -NoNewline)
|
||||
{
|
||||
$i = $k = $r = 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)
|
||||
}
|
||||
|
||||
Write-Host
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue