i'm using haskell gloss for the first time and I'm having some trouble, in this code:
-- the initial c and l will be imagine for dimension 9: (-160) 160
-- (so the square ends in the center of the window
-- column; line; dimension
drawmap :: Float -> Float -> Float -> Picture
drawmap c l d = (drawline x c l d) : (drawmap xs c (l+40) d)
drawline :: Float -> Float -> Float -> Picture
drawline c l d = if (d>0) then (Translate c l $ Color red (circle 20)) : (drawline (c+40) l (d-1))
else (Translate c l $ Color red (circle 20))
The only question I have right now is with the type, because I need it to be the type Picture, and not [Picture], any help?
And also, how do i make this stop point:
drawline _ _ 0 = Nothing or []
I know this is not acceptable, but how do I tell it when to stop doing circles?
This is not pratical at all, is just an example very simple, if someone helps me understand this I can after apply what I really need to do.