a simple chess game PGN file analyser on command line terminal
this program will generate an .analyzed.pgn file, and a .stats.txt from a pgn file.
The .analyzed.pgn will contain the following:
- per-move comments showing the best move
- per-move comments on how good or bad the move was compared to the best move.
brilliant!!!
- indicates that the move is the best moveexcellent!!
- indicates that the move is a top movegood!
- indicates that the move is still accurate or averageinaccurate?
- indicates that the move provide a slight disadvantagemistake??
- the move is slightly losingblunder/missed
- blunder is a completely losing move, missed is when you give up a large advantage
W
- means that the advantage is so great, the changes of winning is astronomical, as long as you don't blunder big, or played many inaccurate movesL
- means that the disadvantage is so great, the chances of lossing is astronomical, as long as the other side does not blunder big, or played many inaccurate moves
The .stats.txt file will contain
- the total counts of brilliant, excellent, good, average, mistake, blunder, and missed moves in the pgn game.
- it will also provide a percentage representing the accuracy of moves a color played through out the whole game.
the resulting Analyzed pgn is recomended to be loaded on chess gui's like Chess Arena for better visualization.
- standard >= C++17
- Windows MinGW Makefile
- Linux GCC Makefile
Build apgn
git clone https://github.com/mrdcvlsc/analyse-pgn.git
cd analyse-pgn
make
make clean
Install & Uninstall for Linux
sudo make install
sudo make uninstall
Modifier Flags:
-engine [PATH] - the directory location with the
filename of your pgn file
-color [A,W,B] - select one letter from A, W or B, where
W = white, B = black, and A = both
-oskip [+I>=0] - this is the number of moves in the opening
that the engine will not analyse
this value should be >= 0 and < the total moves
-depth [+I>0] - this is how deep the chess engine will analyse
the given pgn file, the larger the number the
the better the analysis, but will also take
more time to finish, this value should be >= 1
-threads [+I>0] - this is the number of the worker threads you want
your engine to use, the more threads the faster
the analysis, given that you did not exceed your CPUs
maximum thread, but if you did a bigger thread will
also slow down the analysis
Defaults Flag values - if a flag is not specified, the default value will be used, below are the default values of each flags :
engine - ../analyse-pgn/bin/engines/stockfish11_x64
color - A
oskip - 4
depth - 11
threads - 1
Example 1 - Using Default Values:
apgn myGame1.pgn myGame2.pgn
Example 2 - Using Costum Values:
apgn -color B -threads 4 myGame1.pgn myGame2.pgn
NOTE: this examples will use the costum values for the specified flags
and use the default values for the unspecified flags.
Installation Part
-
Download the pre-compiled program analyse-pgn | zip | 7z | tar.gz
-
Move and Extract the file where you want to put it permanently
-
Add path of analyse-pgn to your Environment Variables. below are some tutorial on how to do this:
Running The Program (you can skip the steps 1,2,&,3 (Installation Part) after you have done it once)
-
Copy the filepath of the .pgn file you want to analyse
-
Open the command line terminal CMD
-
Follow the format and Paste the pgn's path that you copied to analyse the game
apgn -color COLOR /PATH/GAME.pgn
apgn -color COLOR -oskip OPENING_SKIP -depth DEPTH -threads THREADS /PATH/GAME1.pgn /PATH/GAME2.pgn
Command Format :
or
you can pass as many pgn file you want to the program
example:
let us say for you have downloaded a pgn from one of your online games where you have played as the white piece ... let's call that pgn file yourChessGame.pgn and you want to analyse it.
to do that you need to input the command below in your CMD
apgn C:/Users/%USERNAME%/Downloads/yourChessGame.pgn -color W
the command above will analyse yourChessGame.pgn file in the downloads folder for the player color white, this will produce another pgn file called yourChessGame.analyzed.pgn, this is the pgn file that contains comments for each move on how well you did, and what is the best move for that turn, It will also produce another file called yourChessGame.stats.txt, this will contain statistical information of your moves.
load yourChessGame.analyzed.pgn on chess GUI's like Chess Arena and PGN Viewer to better visualize your moves.