- Admin wrote:
- Thanks for the new tool.
I wonder if it's possible to extract queen | rook | bishop / knight sacrifices.
For instance, Queen sacrifices
r1bqk2r/pppp1Npp/8/2bnP3/8/6K1/PB4PP/RN1Q3R b kq - bm 0-0;
rnb1k2r/pp1pp1bp/6p1/2pn2B1/8/2NB1N2/PqPQ2PP/1R2K2R w Kkq - bm Nxd5;
r1b2r2/pp1nqn2/2pp2kb/4Pp1p/2PP1p2/2N3BP/PPQ1B1P1/3RR1K1 w - - bm Qxf5+;
Need to find the corresponding PGN's but you get the drift.
The problem here is, that the tool works like this:
The SGS-tools searches for a material advantage for (at least) 5 consecutive moves for the color, which
finally looses a game (at least 7 consecutive moves, if 1 pawn-sacrifices are searched, only).
So, if you sac a queen, normally some other capture-moves follow up. And this means, the 5-move (10 plies) counter of pgn-extract is set back to 0 after each capture. When the position is quiter, pgn-extract can count up to 10 plies. Only then, a game is recognized as a sac-game...But therefore, a lot of different piece-patterns are necessary.
For example: Here the piece-patterns for white without queen and black with queen still on board and a high material advantage of 5+ pawnunits for black (out of the file 5_pawnsac_white (bin-folder)): (q=queen r=rook, p=pawn and l=Bishop or Knight)
10 r+l+p3+ q1>=r=l=p*
10 r+l+p3+ q1>=r=l>p*
10 r+l+p3+ q1>=r>l*p*
10 r+l+p3+ q1>=r=l1<=p>
10 r+l+p3+ q1>=r=l1<=p=
10 r+l+p3+ q1>=r=l1<=p1<=
10 r+l+p3+ q1>=r=l2<=p2>
10 r+l+p3+ q1>=r=l3<=p5>
10 r+l+p3+ q1>=r1<=l>p>
10 r+l+p3+ q1>=r1<=l>p=
10 r+l+p3+ q1>=r1<=l>p1<=
10 r+l+p3+ q1>=r1<=l>p2<=
10 r+l+p3+ q1>=r1<=l=p>
10 r+l+p3+ q1>=r1<=l1<=p4>
10 r+l+p3+ q1>=r1<=l2<=p7>
10 r+l+p3+ q1>=r2<=l=p6>
10 r+l+p3+ q1>=r2<=l1>=p3>
10 r+l+p3+ q1>=r2<=l2>=p>
10 r+l+p3+ q1>=r2<=l2>=p=
10 r+l+p3+ q1>=r2<=l3>p*
Here the explanation from pgn-extract help:
The -y and -z flags take a filename of material balances for which you wish to search in games. The --materialy and --materialz arguments offer command-line alternatives to using a file.
The basic structure of the file is one or more lines describing a material balance of the form
pieces1 pieces2
Pieces1 and pieces2 are lists of English piece letters for the material for the two sides that you wish to look for in a game.
The case of the letters is immaterial, there is no need to include Kings in the description, and the order of the pieces does not matter. Apart from Kings, if a piece letter is not listed for a side then that piece is not present within that side's material. With the -z and --materialz flags, a match will be tested for from both White and Black's point of view
Further notation may be added after any piece letter, typically to indicate something about the number of occurrences of that piece on one side. The following are valid for each piece:
* (zero or more of that piece).
+ (one or more of that piece).
d (exactly d occurrences of that piece, where d is a digit).
d+ (d or more occurrences of that piece).
d- (d or fewer occurrences of that piece).
= (the number of these pieces must be the same as the opponent's).
# (the number of these pieces must be different from the opponent's).
> (the number of these pieces more than the opponent has).
< (the number of these pieces less than the opponent has).
d> (the number of these pieces must be at least d more than the opponent's).
d< (the number of these pieces must be at least d less than the opponent's).
d>= (the number of these pieces must be exactly d more than the opponent's).
d<= (the number of these pieces must be exactly d less than the opponent's).