An html version of rookrectangle.cql

; rookrectangle.cql can be downloaded here.
;; look for positions where a rook circles in a 4x3 rectangle
;; we use the rectangle g2, d2, d6, g6 together with shift and flip
;; 
(match 
	;:pgn tmp.pgn 
	:pgn heijden.pgn
	:output out.pgn 
	:forany piece [Rr]
       (position
	$piece[g2]
        :and (
	      (position :gappedsequence ((position :movefrom $piece[g6,d2] :moveto ?g2)))
	      (position :gappedsequence ((position :movefrom $piece[d6,g2] :moveto ?d2)))
	      (position :gappedsequence ((position :movefrom $piece[d6,g2] :moveto ?g6)))
	      (position :gappedsequence ((position :movefrom $piece[g6,d2] :moveto ?d6)))
	      )
	:shift :flip
))