mnm-sys / tezdhar

A fast and unbeatable chess engine written in C
GNU General Public License v3.0
3 stars 1 forks source link

Validate user input move and update the board status accordingly #3

Open mnm-sys opened 2 years ago

mnm-sys commented 2 years ago

Goals:

  1. User should be able to input his/her move from command line
  2. The chess engine should check if the move is legal and valid according to the laws of chess
  3. The chess board and board status is updated and displayed to the user

Move Validation:

  1. Ensure player moves his own color pieces only.
  2. Ensure from/to squares of the piece moved follow the piece movement rules.
  3. Check for illegal jumps over other pieces due to the piece movement.
  4. The king should not come in check due to the move i.e. don't move pinned pieces.
  5. Follow en-passant rules.
  6. The board should have only one king present of each color
  7. Make validation rules for King - checkmate, stalemate, castling rules
  8. Make validation rules for Queen
  9. Make validation rules for Bishop
  10. Make validation rules for Knight - can jump over other pieces
  11. Make validation rules for Rook
  12. Make validation rules for Pawns - enpassant and pawn promotion
mnm-sys commented 2 years ago

After inputing the user move text in SAN or UCI format, a SAN parser needs to be implemented which selects the required piece, to-square and from-square, and updates the board accordingly. For example, consider the move Nc3 which means the knight has to move to c3 square, but if the board has two knights, the function should select which of the knights has to move

mnm-sys commented 2 years ago

This issue involves completing following 3 tasks:

mnm-sys commented 2 years ago

Depends on https://github.com/mnm-sys/tezdhar/issues/28

mnm-sys commented 2 years ago

Blocked by #28