Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Defines one move (actually just a half move AKA "ply") of a piece.
- Similar to
Vector
, but the position is fixed.
Synopsis
- data Move
- tag :: String
- nPliesPerMove :: NPlies
- measureDistance :: Move -> Vector
- interpolate :: Move -> [Coordinates]
- mkMove :: Coordinates -> Coordinates -> Move
- isPawnDoubleAdvance :: Move -> LogicalColour -> Bool
Types
Type-synonyms
- A move of a piece.
- Most modern chess-notations (except Standard Algebraic) start with similar information, but also define ancillary information which is captured in MoveType.
Instances
Eq Move Source # | |
Ord Move Source # | |
Read Move Source # | |
Show Move Source # | |
NFData Move Source # | |
Defined in BishBosh.Component.Move | |
Opposable Move Source # | |
Defined in BishBosh.Component.Move getOpposite :: Move -> Move Source # | |
Orientated Move Source # | |
Defined in BishBosh.Component.Move isVertical :: Move -> Bool Source # isHorizontal :: Move -> Bool Source # isParallel :: Move -> Bool Source # isDiagonal :: Move -> Bool Source # isStraight :: Move -> Bool Source # | |
ReflectableOnY Move Source # | |
Defined in BishBosh.Component.Move reflectOnY :: Move -> Move Source # | |
ReflectableOnX Move Source # | |
Defined in BishBosh.Component.Move reflectOnX :: Move -> Move Source # |
Constants
nPliesPerMove :: NPlies Source #
The constant number of plies per move.
Functions
measureDistance :: Move -> Vector Source #
Measures the signed distance between the ends of the move.
interpolate :: Move -> [Coordinates] Source #
Generates a line of coordinates covering the half open interval (source, destination]
.
Constructors
mkMove :: Coordinates -> Coordinates -> Move Source #
Smart constructor.
Predicates
:: Move | |
-> LogicalColour | Defines the side whose move is referenced. |
-> Bool |
- Whether the specified move is a
Pawn
's initial double-advance. - CAVEAT: failing this test guarantees that the move isn't a
Pawn
's double-advance, but passing only guarantees that it is, if it was aPawn
which moved & that the move is valid.