Files
NowChessSystems/.claude/agent-memory/scala-implementer/project_chess_tui.md
T

1.4 KiB

name, description, type
name description type
chess_tui_implementation Chess TUI in modules/core — MVC sub-packages under de.nowchess.chess project

Chess TUI standalone app implemented in modules/core, root package de.nowchess.chess.

Why: Initial feature to demonstrate the system's TUI capability per ADR-001. Refactored to MVC pattern to separate concerns.

How to apply: When extending chess logic (legality, castling, en passant, promotion), build on the existing Board opaque type in model and add extension methods there. The @main entry point is chessMain in Main.scala (root package). Game loop lives in GameController.

Package layout after MVC refactor:

  • de.nowchess.chess.modelModel.scala: Color, PieceType, Piece, Square, Board (opaque type)
  • de.nowchess.chess.viewRenderer.scala: ANSI board renderer
  • de.nowchess.chess.controllerParser.scala: coordinate-notation parser; GameController.scala: game loop
  • de.nowchess.chessMain.scala: @main def chessMain()

Key design choices:

  • Board is an opaque type over Map[Square, Piece] with extension methods
  • Color and PieceType are Scala 3 enums
  • Renderer.render returns String, never prints
  • Parser.parseMove returns Option[(Square, Square)] — coordinate notation only (e.g. e2e4)
  • No move legality validation — moves are applied as-is
  • ANSI 256-colour background codes used for light/dark squares (48;5;223 beige, 48;5;130 brown)