reversecolor
reversecolor
is a rarely used transform filter. It corresponds to the transform reversecolor which is described in more detail in the documentation for flipcolor.
reversecolor F
matches a position reversecolor F
. The effect or reversecolor F
on F
is to swap the roles of white and black and to flip the board about the horizontal bisector. See the above link for more detail.
The -reversecolor
command line option
The major purpose of the reversecolor
filter is to be invoked from the command line. If you have a particular CQL file that tests for something from one side, you can test for the exact same thing from the other side's point of view by using the -reversecolor
command line option.
For example, suppose your file foo.cql
has a body that tests for positions in which black is in mate and each white piece and empty square is defended exactly once:
btm mate square all x in [A_] attackedby k 1==A attacks x
You can invoke this with
cql -reversecolor foo.cqland the file's body will be changed to
wtm mate square all x in [a_] attackedby K 1==a attacks x
This is occasionally useful for experimentation.