RosettaCodeData/Task/Mandelbrot-set/Sidef/mandelbrot-set.sidef
2017-09-25 22:28:19 +02:00

14 lines
261 B
Text
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

func mandelbrot(z) {
var c = z
{ z = (z*z + c)
z.abs > 2 && return true
} * 20
return false
}
 
for y range(1, -1, -0.05) {
for x in range(-2, 0.5, 0.0315) {
print(mandelbrot(x + y.i) ? ' ' : '#')
}
print "\n"
}