Skip to content

Conversation

@hichamABA
Copy link

Summary

This PR adds a small UX improvement to the CLI: after each board display, the program now shows which pieces have been captured by each side.
This mirrors common chess interfaces and makes terminal play more readable without modifying any engine logic.
Example output:
White captured: ♛♟♟♟
Black captured: ♛♜♝♞♟♟

Design sans titre

Implementation Details

  • Added a new helper function printCapturedPieces(board) in src/main.py.
  • Captured pieces are derived from board.history, which already stores a tuple (move, pieceTaken) for every capture.
  • Only printBoard was modified to call the new display function.
  • Sorting ensures higher-value pieces appear first (Q, R, B, N, P).

Why This Change?

  • This improves the user experience when playing the CLI version.
  • Helps players track trades at a glance.
  • Adds value without touching game rules, move generation, or core logic. zero risk of regressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants