An html version of rookrectangle.cql. Created by Gady Costeff and Lewis Stiller.

;; 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 rookrectangle.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
))
After executing this with "> cql RookRectangle.cql" there are 8 studies found in the Harold van der Heijden Database V 2015.
NB. When you see {MATCH} in the text, it means that cql has found the position asked for.

Below only 4 studies are presented: