findis used to search for positions that match a specified filter. The
findfilter has one argument, the filter to search for.
find check x= 1 + find all check find Ra3
findalways starts its search at the currentposition.
The first form of find is used to locate a position in which a given filter is true:
find filterThis form of the
findfilter matches the current position if some future position (always including the current position of course) matches filter. If the find filter does find such a position, that position is returned as the value of the find filter. The
findfilter stops searching the positions when the first such position is found.
The second form of
find is used to find all positions matching a specified filter:
find all filter
The presence of the
all parameter to
find indicates that the
find returns a count of the number of future positions matching filter.However, the
find filter will only match if this count is nonzero.
find checkWill match the next position (starting its search from the current position) that is a check. The value of the
findfilter, if it matches, is that position.
On the other hand,
find all checkwill return the number of future positions that are checks (including the current positions), if that value is nonzero.
A variant of this form allows a range to be specified:
find range filterThis form matches the position if the number of future positions matching filter lies within range.
x=find 0 1000 check
will set x to the number of future positions that are checks.
searching backwardIf the keyword find is immediately followed by a left arrow
<--then the find looks backward in the game tree instead of forward:
find <-- filter
comments in findBy default,
findwill comment on found positions. This can be turned off by specifying
quietin the CQL header.
findfilter is used in Qq-rotations-90-degree.cql, Qq-rotations.cql, averagedistance.cql, excelsior-comment.cql, excelsior-multiple.cql, excelsior-return.cql, excelsior-simple.cql, most-visited-square.cql, most-visited-square-2.cql, parallelpaths-simple.cql, parallelpaths.cql, platzwechseln1.cql, platzwechseln2.cql, rook-corners-1.cql, rook-corners-2.cql, rook-corners-rotate-with-range.cql.