PGN tool for number of pieces

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
Ozymandias
Posts: 1537
Joined: Sun Oct 25, 2009 2:30 am

PGN tool for number of pieces

Post by Ozymandias »

I don't know if it exists. Maybe it can be done with pgn-extract. I was thinking about a command line tool able to process a PGN and give statistics about the number of pieces on the board in the final position along with the number of moves.
User avatar
Ajedrecista
Posts: 2164
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: PGN tool for number of pieces.

Post by Ajedrecista »

Hello:
Ozymandias wrote: Mon Aug 01, 2022 4:42 pm I don't know if it exists. Maybe it can be done with pgn-extract. I was thinking about a command line tool able to process a PGN and give statistics about the number of pieces on the board in the final position along with the number of moves.
I think that there are tools for both requests and I remember having read something. Using the search engine of TalkChess, I get the following:

Number of pieces in the final position: pgn-extract, Norm's utilities and a tool from Ferdy:

Re: Games with material balance.

Re: Chess Tools

The second thread is long, but also useful. Give it a try.

Number of moves: I guess that Norm's utilities will do the task. Probably pgn-extract and Ferdy's tools also.

I suppose that you want something like:

Code: Select all

GAME     PIECES     MOVES
0001        8        79.5
0002        7        60.5
[...]
0300       11       111.0
Where 1 move = 2 plies. If not, please specify your exact request and probably someone is kind enough to provide a tool or a method via combining more than one tool. I am not a programmer, but I think it is easy for many people here to extract those two parameters in each game and you can be lucky.

Are you trying to find a correlation between moves and pieces remaining? If that, I wish you good luck. I saw something similar on the Internet few years ago, but with material instead of moves (P = 1, N = 3 and so on):

https://web.archive.org/web/20160318013 ... stics.html

Regards from Spain.

Ajedrecista.
User avatar
Ozymandias
Posts: 1537
Joined: Sun Oct 25, 2009 2:30 am

Re: PGN tool for number of pieces.

Post by Ozymandias »

Ajedrecista wrote: Mon Aug 01, 2022 8:53 pmAre you trying to find a correlation between moves and pieces remaining?
I am, for adjudication purposes. The idea is to run the database trough the tool so that I know what percentage of games finish at move N and get a list of the percentage of games for N with any number of pieces left (P). For example:

Code: Select all

N    %  P   %
40  20  2   1
40  20  3   4
40  20  4   5
...
60  10  5   0.6
...
90  0.1 6   20
90  0.1 5   30
Or something remotely similar.

Getting the number of games is valid, of course, but % saves time doing additional calculations.

I saw those threads you mention, but installing Python? Not looking forward to that.