Mandelbrot set: Difference between revisions
→{{header|bc}}
m (→ASCII output: fix links) |
|||
Line 1,861:
[[File:Mandelbrot-bc.jpg|thumb|right]]
Producing a [https://fr.wikipedia.org/wiki/Portable_pixmap PGM] image.
To work properly, this needs to run with the environment variable BC_LINE_LENGTH set to 0.
<syntaxhighlight lang=bc>max_iter = 50
width = 400; height =
scale = 10
xmin = -2; xmax = 1/2
Line 1,891 ⟶ 1,894:
print "P2\n", width, " ", height, "\n255\n"
for (i = 0; i <
for (j = 0; j <
tmp_scale = scale
scale = 0
m = (255 * mandelbrot(x, y) + max_iter + 1) / max_iter
print m
if ( j <
scale = tmp_scale
|