Generation

generate functionSat, 12 Nov 2022

generate mandelbrot art

--create a function max_iter :: Int max_iter = 1000 diverge :: Int -> Bool diverge n = n == max_iter mag :: Float -> Float -> Float mag x y = x*x + y*y mandelbrot :: Float -> Float -> Int mandelbrot x y = loop 0 0 0 where loop :: Int -> Float -> Float -> Int loop iter x y | diverge iter = iter | otherwise = loop (iter+1) (x*x - y*y + x) (2*x*y + y)

Want to kickstart your project?Use the new AI Studio to create your code