Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toString (Board map) =
- " " ++ joinListOfStrings (Prelude.map charToString [x | x<-['A'..'S']]) ++ "\n" ++ joinListOfStrings (Prelude.map combine [Coordinates x y | x <- [1..19], y <- [1..19]])
- where
- combine s = index s ++ mapToCharacter s ++ newLine s
- 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