An html version of samecolorbishops.cql
; samecolorbishops.cql can be downloaded here.
; Search for games with that have either two light-squared white
;bishops, two dark-squared white bishops, two dark-square black
;bishops. or two light-square black bishops.
;There are two ways to do this. One is to simply have a giant :or with 4
;:piececount clauses in the or:
;(position
; :or(
; (position
; :piececount B[a1,a3,a5,a7,b2,b4,b6,b8,c1,c3,c5,c7,d2,d4,d6,d8,e1,e3,e5,e7,f2,f4,f6,f8,g1,g3,g5,g7,h2,h4,h6,h8] 2 9 )
; (position
; :piececount b[a1,a3,a5,a7,b2,b4,b6,b8,c1,c3,c5,c7,d2,d4,d6,d8,e1,e3,e5,e7,f2,f4,f6,f8,g1,g3,g5,g7,h2,h4,h6,h8] 2 9)
; (position
; :piececount b[a2,a4,a6,a8,b1,b3,b5,b7,c2,c4,c6,c8,d1,d3,d5,d7,e2,e4,e6,e8,f1,f3,f5,f7,g2,g4,g6,g8,h1,h3,h5,h7] 2 9)
; (position
; :piececount B[a2,a4,a6,a8,b1,b3,b5,b7,c2,c4,c6,c8,d1,d3,d5,d7,e2,e4,e6,e8,f1,f3,f5,f7,g2,g4,g6,g8,h1,h3,h5,h7] 2 9)
; )
;)
; But a more elegant way is to use the following code, which relies on
; the fact that flipping the board horizontally changes the color of the
; squares:
(match
:pgn heijden.pgn
:output out.pgn
(position
:piececount
B[a1,a3,a5,a7,b2,b4,b6,b8,c1,c3,c5,c7,d2,d4,d6,d8,e1,e3,e5,e7,f2,f4,f6,f8,g1,g3,g5,g7,h2,h4,h6,h8]
2 9
:flipcolor
:fliphorizontal
:markall
)
)