An html version of staircase.cql

; staircase.cql can be downloaded here.
;;This filter file looks for queen staircases
;;search for a queen staircase. 
;;
;;The "shift" and the "flip" commands are used to take the given sequence
;;and make sure it can be started from any square and any direction
;;
;;The "flipcolor" command is used to make sure that it works with black queens too.

;; Because there is no :variations keyword, this only searches for staircases in the
;; main line.

;; Because of the presence of both :shift and :flip commands, this query takes a long time.

(match
 :pgn heijden.pgn
 :output out.pgn
 (position
  :sequence
    ((position Qa2) 
     (position) 
     (position Qb2) 
     (position) 
     (position Qb3) 
     (position) 
     (position Qc3)
     (position)
     (position Qc4))
    :shift 
    :flip
    :flipcolor
))