Skip to content

Commit

Permalink
Unblock game start
Browse files Browse the repository at this point in the history
  • Loading branch information
necosta committed May 26, 2023
1 parent 699c268 commit 767ef8b
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,31 @@ private def chessGame(moves: List[ChessMove], gameState: GameState)(using scope:
val previousMoves = moves.map(m => m.player + ":" + m.move).mkString(", ")
println(s"Previous moves: $previousMoves")

val movePrompt =
s"""
|$currentPlayer, you are playing chess and it's your turn.
|These are the previous chess board moves: $previousMoves
|Make your next move:
val movePrompt = moves match {
case Nil => s"""
|$currentPlayer, you are playing chess and it's your turn.
|These are no previous chess board moves.
|Make your first move:
""".stripMargin
case l => s"""
|$currentPlayer, you are playing chess and it's your turn.
|These are the previous chess board moves: $previousMoves
|Make your next move:
""".stripMargin
}
println(movePrompt)
val move: ChessMove = prompt(movePrompt)
println(s"Move is: $move")

val boardPrompt =
s"""
|Given the following chess moves: ${moves.map(m => m.player + ":" + m.move).mkString(", ")},
|Given the following chess moves: $previousMoves,
|generate a chess board on a table with appropriate emoji representations for each move and piece.
|Add a brief description of the move and it's implications
""".stripMargin

val gameBoard: ChessBoard = prompt(boardPrompt)
println(s"Current board:\n${gameBoard.board}")
val chessBoard: ChessBoard = prompt(boardPrompt)
println(s"Current board:\n${chessBoard.board}")

val gameStatePrompt =
s"""
Expand Down

0 comments on commit 767ef8b

Please sign in to comment.