bristol-universal.cql

// Download bristol-universal.cql
// PGN output when run on sample.pgn

/************
Find all Bristols orthogonal or diagonal.
Here a front line piece (Front) moves to a destination.

Later, along the same line, a back line piece (Back) follows the
path of Front, crossing the same squares it does, and landing
just behind it.

The results are sorted by the length of the move
by Back (which must traverse at least 3 squares to be
included).
*************/

cql(input hhdbvi.pgn quiet)
 Front Back{
   FrontStart=Front
   ///"Bristol with Front: " Front " and Back: " Back
   FrontBack
     Front  ///"Front moves to " Front
               not check
     Back +
            FrontBackFrontStartfrom or
	    from==FrontStart and FrontBackfrom
            not FrontBack
            ///"Thematic Bristol move from " from
            sort "length of Bristol move"
	         between(from Front)  3
   }