Movement Formula

Introduction

This notation is an attempt to provide a precise unambiguous formulaic representation of the move of a chess or fairy chess piece. The initial presentation assumes a 2-dimensional board composed of square cells,

Syntax

The step

This is the basic building block and describes the position of the destination square in terms of the number of vertical and horizontal squares separating it from the starting square.

Thus a single orthogonal step is written as {1,0} (the order of the figures is immaterial but I shall adopt the convention of writing the larger number first)
A single diagonal step is written as {1,1}., while {2,1} is an hippogonal step (the knight's leap).

Direction

Where direction is important we add

  • ^ forward
  • v backward
  • > right
  • < left

Grouping

Symbols may be grouped using {}, [], or ()

  • {} groups compounds: thus {^>} means forward AND right.
  • [] groups alternatives: thus [^v] indicates forward OR backward. Priority is indicated by a !. So [^!<>!v] indicates forward moves must be made if possible, else sideways, and backwards only if no other direction is possible.
  • () groups phrases: a phrase is a set of symbols to be treated within the formula as a single symbol.

Destination

If the state of a square is significant then this is indicated by

  • # when empty
  • $ when containing any friendly piece
  • % when containing any enemy piece
  • $|+ when containing the same type of friendly piece
  • %|+ when containing the same type of enemy piece
  • $|- when containing a different type of friendly piece
  • %|- when containing a different type of enemy piece
  • $|x when protected by a friendly piece
  • $|o when not protected by a friendly piece
  • %|x when attacked by an enemy piece
  • %|o when not attacked by an enemy piece
  • m+ when the destination of the previous move
  • m- when the origin if the previous move

Non-destination squares

Information is enclosed between / / thus

  • /{1,0}v%/ means the square orthogonally adjacent and behind the destination contains an enemy piece.

Continuation

Having reached a destination square the next action may be

  • @ move ends
  • x capture the piece at the destination
  • + continue the move
  • = transform/promote to another piece
  • - capture a piece not at the destination as indicated by the phrase following the -

Repetition

  • * following a step or step-phrase indicates it should be repeated. Without other symbols there is no limit to the number of repetitions but the direction of movement may not be changed (the movement is linear).
  • : placed after the * and followed by a single number sets the maximum number of repetitions. If followed by two or more numbers then when the separator is
    • ; the preceding number of repetitions is required.
    • the numbers either side are the minimum and maximum.
  • ~ placed after the * indicates the direction of movement may be changed (the movement is crooked). Return to the starting square is not permitted.
  • ? placed after the * again indicates the direction of movement may be changed (the movement is crooked). However, return to the starting square is permitted.

Board and State Related

  • A move may be tied to a particular square or set of squares (a zone). In the movement formula these are represented by z followed by a number. The nature of the zone should be given in a footnote to the formula.
  • A move may be related to a state, for example never moved. These are represented by s followed by a number and should be explained in a footnote. s0 is used for the never moved state.

Examples

King

  • [{1,0},{1,1}]{(%|o),[(#@),(%x@)]}

Rook

  • ({1,0}[(#+),(#@),(%x@)])*

Bishop

  • ({1,1}[(#+),(#@),(%x@)])*

Knight

  • {2,1}[(#@),(%x@)]

Pawn

  • [({1,0}^(#@)),(s0({1,0}^[(#+),(#@)])*:1;1),({1,1}^[(%x@),({#,/{1,0}v{%+,m+}/,/{1,0}^{#,m-}/}-({1,0}v)@)]
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.