Safe Haskell | None |
---|---|
Language | Haskell2010 |
- runRender :: GameState -> GameConfig -> [Cell] -> String
- runRenderColor :: GameState -> GameConfig -> [Cell] -> (String, [Color])
- putColoredStrTerm :: (String, [Color]) -> IO ()
- putColoredStrHtml :: (String, [Color]) -> IO ()
Documentation
runRender :: GameState -> GameConfig -> [Cell] -> String Source
Returns a String of the game board along with some basic info
runRenderColor :: GameState -> GameConfig -> [Cell] -> (String, [Color]) Source
Returns a String of the game board along with some basic info, and a series of IO () actions, one per character, which describe how to set the terminal color. putColoredStr can be used to apply those actions automatically
putColoredStrTerm :: (String, [Color]) -> IO () Source
Given an input such as the output of runRenderColor, writes the game board along with some basic info, to the screen, applying the IO actions to colorize the output.
putColoredStrHtml :: (String, [Color]) -> IO () Source
This is wasteful compared to having this logic in the browser's javascript. However this is still amounts to very little data being transferred, and that way I can avoid duplicating the coloring logic"