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.Board.Direction

Description

Types and functions to represent and manipulate directions on a chess board.

Synopsis

Documentation

data Direction Source #

Represents a two-dimensional direction on a chess board.

Constructors

Direction 

Fields

left :: Direction Source #

Yields the integral vector pointing to the left, where the leftmost column is labelled A.

right :: Direction Source #

Yields the integral vector pointing to the right, where the leftmost column is labelled A.

up :: Direction Source #

Yields the integral vector pointing up, where the lowest row is labelled 1.

down :: Direction Source #

Yields the integral vector pointing down, where the lowest row is labelled 1.

orthogonals :: [Direction] Source #

Yields the four integral vectors in the directions up, right, down and left.

diagonals :: [Direction] Source #

Yields the four integral vectors in the directions left up, right up, right down and left down.

principals :: [Direction] Source #

Yields the combination of orthogonal and diagonal integral vectors.

jumps :: [Direction] Source #

Yields the eight directions a knight is able to jump, according to the standard rules.