game tree location

CQL has a few filters that describe where the current position is in the game tree:

filter name example description
beginvariation beginvariation current position starts a new variation
initial initial current position is first position of game
mainline mainline current position is in a main line
movenumber movenumber 20 30 move number of current position is in range
terminal terminal current position has no successors
variation variation current position is in a variation

Note: by "variation" here we always exclude the mainline - there is no "mainline variation" in CQL terminology.

variations parameter and game location filters

If the variations parameter is set then the tree considered in the above filters is the full game tree. However, if the variations parameter is not set, the the tree considered is only the single mainline branch.