index Back to help overviewhome Back to home page

CQL - Square designators

Square designators

A square designator defines a set of squares.

An empty square designator denotes all 64 squares of the board. For example: the piece designator has an empty square designator. Hence, this piece designator denotes a white rook anywhere on the board.

A simple square designator comprises two characters, the first of which is a file, and the second a rank, in the usual chess notation. If the file character is ? then files a through h are designated. If the rank character is ? then ranks 1 through 8 are designated. For example: the piece designator b3 has a simple square designator denoting the square b3, and denotes a black bishop on b3.

There is also a special square designator (not belonging to the CQL standard): as character for the files is designating all light-squared fields on the files a through h. Accordingly is designating all dark-squared fields on these lines. and can also be used for the designation of the ranks. But it is not allowed to use this special square designator both for lines and ranks, this means for example that is not allowed.

Compound square designators

A compound square designator can denote more than one square. One type of compound square designator comprises a file designator followed by a rank designator. A file designator comprises either the name of a file or the names of two files separated by hyphens. A rank designator comprises either the name of a rank or the name of two ranks separated by hyphens. A three-character file designator denotes all the files inclusive between the files designated by its first and last characters. A three-character rank designator denotes all the ranks inclusive between the ranks designated by its first and last characters. A compound square designator can also comprise a sequence of square designators separated by commas. The set of squares so represented is the union of the sets of squares represented by each of the constituent square designators.

Any compound square designator not contained in brackets must be contained in brackets.

Crazyhouse, and Bughouse Chess: a further special square designator exists (not belonging to CQL standard); the backhand – the place of the captured pieces – will be designated with [+]. Note that the designation ??, as well as the empty square designator, does not include the backhand. To designate all squares inclusive the backhand the shortcut [*] is allowed. The notation with backhand is also possible in other chess variants, in this way a skript can be written for all chess variants altogether.

Examples of compound square designators

[a-c1] denotes the three squares a1, b1, and c1.
[b3-5] denotes the squares b3, b4, and b5.
[f-h6-8] denotes the squares f6, f7, f8, g6, g7, g8, h6, h7, and h8.
[a1,c4] denotes the squares a1 and c4.
[a-h1-2,a8,h8] denotes the first two ranks plus a8 and h8.
[?] denotes all light-squares fields.
[1] denotes all dark-squares fields on the first rank.
[+] denotes the backhand (Crazyhouse, Bughouse Chess).
[+,a1] denotes the backhand and square a1 (Crazyhouse, Bughouse Chess).
[*] denotes alle squares inclusive the backhand (Crazyhouse, Bughouse Chess).
[ ] denotes no squares at all. This is very different from the empty square designator, which designates all squares.

Examples of piece designators

denotes a white knight in the backhand (Crazyhouse, Bughouse Chess).
a1 denotes a white minor piece on a1. It will match any position with a white bishop or white knight on a1.
[a-h1-2] will match any position with a white rook on the first two ranks.
[][a-h1-2,a8,h8] will match any position that has a white piece or a black rook on the first two ranks or the corners.
[][a1,h1,a8,h8] will match any position with a white non-king piece at the corners.
[]? will match any positions with a light-squares bishop.
[+]
[ ] denotes a white bishop on an empty set of squares. This can never match any position of course.