chessIO-0.0.0.0

Copyright(c) Mario Lang 2019
LicenseBSD3
Maintainermlang@blind.guru
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Game.Chess

Contents

Description

A small collection of data types and functions to represent Chess positions and moves including move generation and parsing from external sources.

This module does deliberately not implement any search or evaluation functionality. It is intended to be used to lay the ground for communicating with other programs or players, hence the package name chessIO.

Synopsis

Representing chess positions

data Position Source #

Instances
Eq Position Source # 
Instance details

Defined in Game.Chess

startpos :: Position Source #

The starting position as given by the FEN string "rnbqkbnrpppppppp8888PPPPPPPP/RNBQKBNR w KQkq - 0 1".

Converting from/to Forsyth-Edwards-Notation

fromFEN :: String -> Maybe Position Source #

Construct a position from Forsyth-Edwards-Notation.

toFEN :: Position -> String Source #

Convert a position to Forsyth-Edwards-Notation.

Chess moves

data Move Source #

Instances
Eq Move Source # 
Instance details

Defined in Game.Chess

Methods

(==) :: Move -> Move -> Bool #

(/=) :: Move -> Move -> Bool #

Converting from/to algebraic notation used by the Universal Chess Interface

fromUCI :: String -> Maybe Move Source #

Parse a move in the format used by the Universal Chess Interface protocol.

toUCI :: Move -> String Source #

Convert a move to the format used by the Universal Chess Interface protocol.

Validating that a move is actually legal in a given position

relativeTo :: Position -> Move -> Maybe Move Source #

Validate that a certain move is legal in the given position.

Move generation

Executing moves