@@ -11,7 +11,7 @@ import scala.util.chaining.scalaUtilChainingOps
1111/** TTT UI controller. */
1212object GameUI {
1313
14- // ??? enhance; maybe just put clean strings in; maybe build on GameResult (plus quit case)
14+ // ?? enhance; maybe just put clean strings in; maybe build on GameResult (plus quit case)
1515 case class GameUIResult (text : String )
1616
1717
@@ -35,8 +35,6 @@ object GameUI {
3535 // (Could put strings in enumerators and use Enum.withName to factor down
3636 // parse function, but then layers wouldn't be separated.)
3737
38- // ?? revisit String (but may be fine since dealing with input _strings_
39- // from _user_
4038 // ?? revisit Either--use something fancier (MonadError)?
4139 private def parseCommand (rawCmd : String ): Either [String , UICommand ] = {
4240 import UICommand ._
@@ -88,7 +86,7 @@ object GameUI {
8886 uiState.copy(gameState = newGameState)
8987 case Left (errorMsg) =>
9088 // ??? probably change return value to carry state plus any message
91- // (or possibly Either, with caller displaying)
89+ // (or possibly Either, with caller displaying)
9290 io.printError(errorMsg)
9391 uiState // no change
9492 }
@@ -124,7 +122,7 @@ object GameUI {
124122 case None => // game not done yet (after valid _or_ invalid mark try)
125123 newState.asRight
126124 case Some (gameResult) =>
127- import GameState .GameResult ._ // ??? unnest? leave?
125+ import GameState .GameResult ._
128126 val resultText =
129127 gameResult match {
130128 case Draw => " Game ended in draw"
@@ -159,7 +157,7 @@ object GameUI {
159157 }
160158 }
161159
162- // ???? soon, probably create class GameUI to hold NameThisIO (to avoid passing
160+ // ??? soon, probably create class GameUI to hold NameThisIO (to avoid passing
163161 // all around); but think about currently pure methods vs. using IO member)
164162
165163 // ??? add more GameUI tests:
0 commit comments