Cantor set: Difference between revisions

Content deleted Content added
Petelomax (talk | contribs)
m →‎{{header|Phix}}: added syntax colouring the hard way
Hout (talk | contribs)
Line 891:
Or, using strings for the model as well as the display:
 
<lang haskell>importcantor Data.Bool:: (bool)[String] -> [String]
 
cantor :: [String] -> [String]
cantor = (go =<<)
where
go x =
in| bool'█' == head [x] = [block, replicate m ' ', block] ('█' == head x)
let m = quot (length x) 3
| blockotherwise = take m [x]
where
in bool [x] [block, replicate m ' ', block] ('█' == head x)
let m = quot (length x) 3
block = take m x
 
cantorLines :: Int -> String