From 41f1bc178dbc777f0913a877bef1ef85e22ea5ce Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 24 Oct 2014 10:51:20 -0400 Subject: pull the number of iterations out into a variable --- fractal.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fractal.jl b/fractal.jl index dce606b..c12400b 100644 --- a/fractal.jl +++ b/fractal.jl @@ -2,6 +2,8 @@ using Tk using Images using ImageView +iterations = 90 + mandelbrot(z, c) = z.^2 + c img = [ Color.HSV(0, 0, 0) for x=1:1000, y=1:1000 ] @@ -10,9 +12,9 @@ z = c imgc, imgslice = view(img) -for i = 1:90 +for i = 1:iterations z = mandelbrot(z, c) - img[abs(z) .> 50] = Color.HSV(i * 4, 1, 1) + img[abs(z) .> 50] = Color.HSV(i * 360/iterations, 1, 1) view(imgc, img) end -- cgit v1.2.3