> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/m/mandelbrot_set.md).

# Mandelbrot set

```ruby
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"
}
```
