TU-CSCI2322-FL22 / solver-connect-three

solver-connect-three created by GitHub Classroom
0 stars 0 forks source link

Suggestions for prettyShowGame #20

Closed sfogarty closed 1 year ago

sfogarty commented 1 year ago

https://github.com/TU-CSCI2322-FL22/solver-connect-three/blob/428193792e0f9f33525fa7948fe4cf125dfec017/Main.hs#L92-L102

  1. make a showCell :: Maybe Player -> String/Char
  2. Option 1: showMicroGame :: MicroGame -> (String,String,String). Then showMacroGame ([one,two,three,four,five,six,seven,eight,nine], player) = let topRows = showThreeGames one two three middleRows = showThreeGames four five six
  3. Option 2: showFirstLIne :: MicroGame -> String and again for 2 and 3. Pattern match apporpriately and combined.
  4. Either way, use intercalate " || " to combine the lines. intercalate generalized unwords and unlines.
  5. Then use unlines at the very end to combine the 9 lines. Be sure to abstract out that lines 1-3, 4-6, and 7-9 are the same function.