(match :pgn heijden.pgn ;the name of the PGN file to look for studies :output wcct8.pgn ;the name of the result file, must be nonempty :forany thematic [QRBN] (position :shift ;e4 is any square :sequence ( (position :wtm :nocheck [QRBN]e4 ; the first thematic piece A :attackcount a ?e4 1 9 ; attacked :attackcount A ?e4 0 ; but not guarded :attackcount a $thematic 0 ;the second thematic piece B not attacked ;as the most attractive possibility :movefrom $thematic ; but it moves :moveto . ; to empty square, no capture :tagmatch thematic [QRBN] ; and it is not pawn );end position (position :nocheck ; not check [QRBN]e4 ; the first thematic piece A :attackcount a ?e4 1 9 ; still attacked :attackcount A ?e4 0 0 ; and still not guarded :attackcount a $thematic 1 9 ; the second piece B is now attacked,too :attackcount A $thematic 0 ; and not guarded, too );end position ); end sequence );end position ); end match