How saadzahem/textual-chess works
textual-chess is a terminal chess game built with Textual. A player launches the app, chooses a bot, and enters a game screen with a chessboard and player/move information; the board handles moves and can request bot moves. The game screen also exposes options such as takeback, draw claims, board flipping, and FEN copying. Bot strategies include random, greedy, and minimax. The README gives no feature overview, so these capabilities and relationships are based on the sampled source; unsampled integrations are not inferred.
Main entry points: chesspage.py Game screen · app.py Chess app · chessboard.py Chessboard · bot.py Bot strategies
Components 15
Terminal interface
- Chess app
src/textual_chess/app.py - Home screen
src/textual_chess/app.py - Text rendering helper
src/textual_chess/utils.py
Game experience
- Game screen
src/textual_chess/chesspage.py - Chessboard
src/textual_chess/chessboard.py - Moves and info
src/textual_chess/chesspage.py - Player display
src/textual_chess/chessplayer.py
Bot strategies
- Bot selection
src/textual_chess/bot.py - Bot strategies
src/textual_chess/bot.py - Minimax search
src/textual_chess/minimax.py
Options dialogs
- Options dialog
src/textual_chess/dialog.py - Modal base
src/textual_chess/modal.py
Chess support
- Board styling
src/textual_chess/constants.py - Repetition tracking
src/textual_chess/_chess.py
Other components
- Player
Connections 15
- Player → Chess app: launches
src/textual_chess/app.py - Chess app → Home screen: shows
src/textual_chess/app.py - Chess app → Game screen: opens
src/textual_chess/app.py - Home screen → Options dialog: opens
src/textual_chess/app.py - Game screen → Bot selection: selects bot
src/textual_chess/chesspage.py - Bot selection → Bot strategies: creates
src/textual_chess/bot.py - Game screen → Chessboard: creates
src/textual_chess/chesspage.py - Game screen → Moves and info: composes
src/textual_chess/chesspage.py - Moves and info → Player display: displays
src/textual_chess/chesspage.py - Chessboard → Bot strategies: requests move
src/textual_chess/chessboard.py - Bot strategies → Minimax search: searches with
src/textual_chess/bot.py - Game screen → Options dialog: opens
src/textual_chess/chesspage.py - Options dialog → Modal base: inherits
src/textual_chess/dialog.py - Chessboard → Board styling: uses styling
src/textual_chess/chessboard.py - Moves and info → Text rendering helper: formats text
src/textual_chess/chesspage.py