celeroncoder / celeroncoder/Chess

Add pawn attacking move at its diagonals.

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Add an attacking or capturing move for Pawn.
> Unlike other pieces, the pawn does not capture in the same direction that it moves. A pawn captures diagonally forward one square to the left or right (see diagram).
>
> Another unusual rule is the en passant capture. It can occur after a pawn advances two squares using its initial two-step move option, and the square passed over is attacked by an enemy pawn. The enemy pawn is entitled to capture the moved pawn "in passing" – as if it had advanced only one square. The capturing pawn moves to the square over which the moved pawn passed (see diagram), and the moved pawn is removed from the board. The option to capture the moved pawn en passant must be exercised on the move immediately following the double-step pawn advance, or it is lost for the remainder of the game.

For more info, check out the wikipedia entry [here](https://en.wikipedia.org/wiki/Pawn_(chess)#Capturing).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.