Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toString (Board map) =
- " " ++ joinListOfStrings (Prelude.map (\item -> (charToString item)) [x | x<-['A'..'S']]) ++ "\n" ++
- joinListOfStrings (Prelude.map (\element -> ((index element) ++ (mapToCharacter element) ++ (newLine element))) [Coordinates x y | x <- [1..19], y <- [1..19]])
- where
- mapToCharacter coordinates
- | (member coordinates map) = show(fromJust (Map.lookup coordinates map))
- | otherwise = " "
- newLine (Coordinates x y)
- | (y == 19) = "\n"
- | otherwise = ""
- index (Coordinates x y)
- | (y == 1 && x<10) = " " ++ show x
- | (y == 1 ) = show x
- | otherwise = ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement