chessica-0.1.0.0: A Library for Chess Game Logic
Copyright(c) Michael Szvetits 2023
LicenseBSD-3-Clause (see the file LICENSE)
Maintainertypedbyte@qualified.name
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Chess.Rulebook.Standard.Movement.Pawn

Description

Implementation of the movement rule for pawns, according to the standard rulebook.

Synopsis

Documentation

movements :: PlacedPiece Pawn' -> Game -> [Command] Source #

Determines all possible movements (including captures, promotions and en passant) for a given pawn.

oneStep :: PlacedPiece Pawn' -> Board -> [Command] Source #

Determines all possible one-step forward movements (including promotions) for a given pawn.

twoSteps :: PlacedPiece Pawn' -> Board -> [Command] Source #

Determines all possible two-step forward movements for a given pawn.

capture :: PlacedPiece Pawn' -> Board -> [Command] Source #

Determines all possible capture movements (including promotions, excluding en passant) for a given pawn.

enPassant :: PlacedPiece Pawn' -> Game -> Maybe Command Source #

Determines the en passant movement for a given pawn, if possible.