| Summary: | Incorrect judgement of En passant move | ||
|---|---|---|---|
| Product: | CS3343 group25 chess game | Reporter: | Andy <dotafterfootball> |
| Component: | chess game | Assignee: | Andy <dotafterfootball> |
| Status: | IN_PROGRESS --- | ||
| Severity: | critical | CC: | xhuang227-c |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Mac OS | ||
had fixed |
Relating code: if(((Pawn) p).ifFirstMove()&&Math.abs(target_x-x)==2){ ((Pawn) p).changePassantToTrue(); } if(((Pawn) p).ifFirstMove()==false) ((Pawn) p).changePassantToFalse(); In move() function in ChessBoard class, if the piece is a pawn, it can be correctly marked as a special piece that can be eaten by En passant if it moves two in its first move. But the next if condition is wrong since the next step can move other pieces instead of the pawn. Instead, this condition indicates that in the second move of the pawn, it will be marked as cannot do En passant move, which is a bug.