This table lists the filters in CQL as well as parameters or keywords each filter uses. This table is not normative: consult the documentation for the filter for the normative definition.
This table does not include symbolic filters: ――, ., _, :, &, <, >, >=, ∊, =, =?, ==, !=, ∩, +, *, %, /, -, ~, |, {}
, #, +=, -=, /=, *=, %=, ~~, [], ∪. For unicode symbols, see unicode symbols.
Deprecated filters are crossed out.
Table of Filters
Name | parameters | arguments | example |
---|---|---|---|
A | A==2 | ||
a | a==2 | ||
abs | number | abs #A - #a | |
(position position) | ancestor(source target) | ||
and | filter/filter | check and Q==2 | |
ascii | string or number | X=ascii "A" Y=ascii 65 | |
assert | filter | assert X==0 | |
atomic variables | variable | atomic X=1 | |
set/set | _ attackedby k | ||
set/set | A attacks k | ||
B | B==2 | ||
b | b==2 | ||
between | (set set) | between(R k) | |
black | black | ||
btm | btm | ||
castle | castle | ||
check | check | ||
child | (number) | child(3) | |
child | child | ||
set | colortype d4 | ||
comment | (filter...) | comment("x is" x) | |
connectedpawns | connectedpawns | ||
consecutivemoves | range quiet | (position position) | consecutivemoves(source target) |
countmoves | ―― filterlegal ―― filterpseudolegal ―― filter | countmoves legal ♔―― | |
currentmove filter | ―― filter | not currentmove ――=△ | |
currentposition | currentposition | ||
currenttransform | currenttransform | ||
dark | set | dark B | |
date | implicit search parameter | date~~"199[5-9]" | |
depth | depth>4 | ||
(position position) | descendant(source target) | ||
dictionary | dictionary X["a"]="bc" | ||
distance | (position position) | distance(source target) | |
doubledpawns | doubledpawns>= 4 | ||
down | range | set | down P |
echo | in all echo quiet | (variable variable) | echo(s t)s&t==. |
eco | implicit search parameter | X=eco | |
elo | white black | elo>2700 | |
event | implicit search parameter | x=event | |
eventdate | implicit search parameter | eventdate~~"199[4-7]" | |
false | false | ||
fen | string | X=fen | |
file | set | file K | |
find | rangeall quiet <-- | filter | find check find all check |
flip | count | filter | flip Ad4 attacks k |
flipcolor | count | filter | flipcolor A attacks k |
fliphorizontal | count | filter | fliphorizontal Ae1 attacks k |
flipvertical | count | filter | flipvertical Ae1 attacks k |
from | x=from | ||
function | {filter} | function square(x) {x * x} | |
gamenumber | gamenumber==1000 | ||
hascomment | string | hascomment "good" (deprecated) | |
Heijden database VI interface | see documentation | hhdb composer "Reti" hhdb sort award | |
idealmate | idealmate | ||
idealstalemate | idealstalemate | ||
if | testfilter consequent | if check "In check" | |
if | testfilter consequent else elsefilter | if check "In check" else "safe" | |
in | set/set | R in (A attacks k) | |
in | string/string | "Q" in fen | |
indexof | string string | indexof("King" "a King")==2 | |
initial | initial | ||
initialposition | initialposition:check | ||
int | string | int "64" == 64 | |
isbound | isbound Foo | ||
isolatedpawns | isolatedpawns>3 | ||
isunbound | isunbound Foo | ||
K | K attacks n | ||
k | k attacks n | ||
lastgamenumber | gamenumber==lastgamenumber | ||
lca | (position position) | lca(source target) | |
legal | ―― filter | legal ♔――a-h4 | |
left | range | set | left P |
pseudolegal | ―― filter | pseudolegal ♔――a-h4 | |
light | set | light B==2 | |
filter | line-->move promote A-->mate | ||
local | dictionary | local dictionary D | |
loop | filter | loop {child(i) i+=1} | |
lowercase | string | lowercase "Tal"=="tal" | |
mainline | mainline | ||
makesquare | (number number) | makesquare(File Rank) | |
mate | mate | ||
max | (number number) | max(#R #Q) | |
message | message quiet | (filter...) | message("x is " x) |
min | (number number) | min(#R #Q) | |
modelmate | modelmate | ||
modelstalemate | modelstalemate | ||
move from K to _ | |||
movenumber | movenumber>100 | ||
N | N==2 | ||
n | n==2 | ||
northeast | range | set | northeast P |
northwest | range | set | northwest P |
not | filter | not mate | |
notransform | filter | notransform a4 | |
nullmove | nullmove | ||
o-o | o-o | ||
o-o-o | o-o-o | ||
or | filter/filter | check or stalemate | |
originalcomment | string | originalcomment "good" | |
P | P==2 | ||
p | p==2 | ||
parent | parent:check | ||
passedpawns | passedpawns>= 6 | ||
⊢ / path | primary focus (or ◎)max verbose keepallbest title piecepath quiet nestban firstmatch lastposition | various | path -- check + |
pathcount | pathcount | ||
pathcountunfocused | pathcountunfocused | ||
pathlastposition | pathlastposition | ||
pathstatus | pathstart | ||
persistent | quiet | variable=number | persistent x=5 |
piece | in all | filter | piece x in A x attacks k |
piecename | set | piecename d4 | |
piece assignment | variable=set | piece x = K | |
pieceid | set | pieceid x | |
pin | from through to | pin from Q | |
player player white player black | implicit search parameter | player "Kasparov" player white ~~ "Kas.*ov" x=player black | |
ply | ply>100 | ||
position | number | position 0 | |
positionid | positionid == 0 | ||
power | set | power A<5 | |
primary | primary | ||
pseudolegal | ―― filter | pseudolegal ♔――a-h4 | |
puremate | puremate | ||
purestalemate | purestalemate | ||
Q | Q==2 | ||
q | q==2 | ||
R | R==2 | ||
r | r==2 | ||
rank | set | rank K == rank k | |
ray | direction | (set...) | ray (R a k) |
readfile | string | X=readfile "a.cqo" | |
removecomment | removecomment | ||
result | string | result "1-0" | |
reversecolor | count | filter | reversecolor A attacks k |
right | range | set | right P |
rotate45 | count | filter | rotate45 A attacks right k |
rotate90 | count | filter | rotate90 A attacks up k |
secondary | secondary | ||
settag | (quoted string string or int) | settag("MyTag" "blunder") | |
shift | count | filter | shift A e1 attacks kg1 |
shifthorizontal | count | filter | shifthorizontal Ae1 attacks kg1 |
shiftvertical | count | filter | shiftvertical Ae1 attacks kg1 |
sidetomove | sidetomove==white | ||
site | implicit search parameter | site "Berlin" x=site | |
sort | min documentation | number or set | sort "Material" power A |
sqrt | number | sqrt 10000 | |
square | in all | filter | square s in _ k attacks s |
stalemate | stalemate | ||
str | (filter...) | X=str("K on: " K) | |
tag | quoted string | tag "UTCDate" | |
terminal | terminal | ||
to | y=to | ||
true | true | ||
try | try | ||
type | set | type d4 | |
typename | set | typename d4 | |
unbind | variable dictionary dictionary[string] | unbind X unbind Dict["ch"] | |
up | range | set | up P |
uppercase | string | uppercase "tal"=="TAL" | |
variation | variation | ||
virtualmainline | virtualmainline | ||
while: standard form | (test)body | while(x<3){z+=1 x+=1} | |
while: ~~ form | (target~~pattern)body | while(player~~".")... | |
white | white | ||
writefile | (filename contents) | writefile("a.cqo" fen) | |
wtm | wtm | ||
(set...) | xray(R a k) | ||
year | year>2000 |