Skip to content

Game logic: Illegal moves being accepted #16

@zzril

Description

@zzril

So far, the game logic / rules of chess are not yet fully implemented.
I think it would help to have one place to track all rule violations that have been found so far, because not all of them are obvious and (at least for now) it can be hard to reproduce them.

All the illegal moves that I could produce so far:

  1. King not moving out of check.
    1b. King moving into check.
    1c. King can be captured. (Should be solved if 1 and 1b are handled properly.)
  2. Pawns not promoting. (You can input a move such as e8=Q, but the parser just ignores everything from the = on. The pawn will move to e8 and stay there as a pawn. Further moves with this piece will not be accepted.)
  3. Stalemate not recognised. (If human is stalemated, the game still asks for a move; if computer is stalemated, game crashes (due to timeout?).)
  4. "Ambiguous moves" not handled properly. (E. g. I had a case where 2 different knights could go to h2, yet the game accepted my move Nh2 and just chose one of them - correct behaviour would be to reject the move.)
  5. Castling accepted after rook has moved. (E. g. I played Rh2, later Rh1, later 0-0.)
  6. En-passant captures are not accepted. (At least not the notations hxg6 and hxg6e.p. or fxg6 e.p. - it's hard to get into situations where you have this move available :p )

Metadata

Metadata

Assignees

No one assigned

    Labels

    hacktoberfestCounts towards Hacktoberfest

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions