Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: Haskell  |  size: 0.26 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import Data.Complex
  2.  
  3. mandelbrot a = iterate (\z -> z^2 + a) a !! 500
  4.  
  5. main = mapM_ putStrLn [[if magnitude (mandelbrot (x :+ y)) < 2 then '*' else ' '
  6.                            | x <- [-2, -1.9685 .. 0.5]]
  7.                            | y <- [1, 0.95 .. -1]]