Last active
August 29, 2015 14:10
-
-
Save DataKinds/11d9281c8b9026c4acbe to your computer and use it in GitHub Desktop.
Codegolfed Mandelbrot Renderer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Complex | |
import Data.List | |
main=let(q,w,e,r,t,y,u)=(-2,1,0.01,-1.25,1.25,0.01,9)in writeFile"m.pgm"(("P2\n"++(show$length[q,(q+e)..w])++" "++(show$length[t,(t-y)..r])++"\n1\n")++((unlines.map(unwords.map(unwords.map show)))$((map.map)(\x->if x==(-1)then[0]else[x]))((map.map)(\c->(\c->if(magnitude$((iterate((\b a->a^2+b)c)(0:+0))!!u))>2then-1else 1)c)[[a:+b|a<-[q,(q+e)..w]]|b <-[t,(t-y)..r]]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment