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

; Find games in which some knight has visited at least twenty different squares.
; This works by counting positions such that the knight will not again visit
; the square on which it currently sits. Squares visited by a pawn that promotes to 
; a knight are not included in the count.
;

(match :pgn heijden.pgn
       :output differentsquares.pgn
       :forany knight [Nn] ; loop for each possible knight
       (position
	:tagmatch knight [Nn]d4 ; Tagged piece is actually a knight on d4, not a pawn
	:and         ; make sure this is the last such occurrence
	((position :not :gappedsequence 
		   ((position) (position $knight[d4]))))
	:shift       ; now repeat, with other squares instead of d4
	:matchcount 20 65 ; match when at least 20 distinct squares found
	:noannotate  ; do not print "MATCH" when a match is found
	))

After executing this with "> cql DifferentSquares.cql" there are 12 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: