Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrdcvlsc/analyse-pgn
a simple CLI chess game PGN-file analyser
https://github.com/mrdcvlsc/analyse-pgn
analysis analyzer assistive-technology c chess chess-engine chess-game cli command-line command-line-tool console-tool cplusplus cpp cpp17 evaluation game-analytics helper pgn statistics terminal
Last synced: 9 days ago
JSON representation
a simple CLI chess game PGN-file analyser
- Host: GitHub
- URL: https://github.com/mrdcvlsc/analyse-pgn
- Owner: mrdcvlsc
- License: gpl-3.0
- Created: 2021-10-04T15:15:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T09:17:09.000Z (6 months ago)
- Last Synced: 2024-05-23T09:31:43.553Z (6 months ago)
- Topics: analysis, analyzer, assistive-technology, c, chess, chess-engine, chess-game, cli, command-line, command-line-tool, console-tool, cplusplus, cpp, cpp17, evaluation, game-analytics, helper, pgn, statistics, terminal
- Language: C++
- Homepage:
- Size: 2.79 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# analyse-pgn
![build](https://github.com/mrdcvlsc/analyse-pgn/actions/workflows/build.yml/badge.svg)
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.
1. **```brilliant!!!```** - indicates that the move is the best move
2. **```excellent!!```** - indicates that the move is a top move
3. **```good!```** - indicates that the move is still accurate or average
4. **```inaccurate?```** - indicates that the move provide a slight disadvantage
5. **```mistake??```** - the move is slightly losing
6. **```blunder/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 moves
- **```L```** - 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](http://www.playwitharena.de/) for better visualization.
---------------------------
## Build Support
- 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
```-------------------------------------------
## analyse a pgn game
### The ```--help``` menu
**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.------------------------------
## how to use analyse-pgn in windows (Non-Developers)
**Installation Part**
1. **Download** the pre-compiled program [analyse-pgn](https://github.com/mrdcvlsc/analyse-pgn/releases/tag/v1.1) | [zip](https://github.com/mrdcvlsc/analyse-pgn/releases/download/v1.1/apgn.zip) | [7z](https://github.com/mrdcvlsc/analyse-pgn/releases/download/v1.1/apgn.7z) | [tar.gz](https://github.com/mrdcvlsc/analyse-pgn/releases/download/v1.1/apgn.tar.gz)
2. **Move** and **Extract** the file where you want to put it permanently3. **Add path** of _analyse-pgn_ to your **Environment Variables**. below are some tutorial on how to do this:
- [example1 - From Microsoft](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)#:~:text=To%20add%20a%20path%20to%20the%20PATH%20environment%20variable&text=In%20the%20System%20dialog%20box,to%20Path%20and%20select%20it.)
- [example2 - Architect Ryan's Blog](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/)
- [example3 - From Aseem Kishore](https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/)**Running The Program** (you can skip the steps 1,2,&,3 (Installation Part) after you have done it once)
4. **Copy** the filepath of the _.pgn_ file you want to analyse
4. **Open** the command line terminal **CMD**
5. **Follow the format** and **Paste** the pgn's path that you copied to **analyse** the game
**Command Format :**
- **```apgn -color COLOR /PATH/GAME.pgn ```**
or
- **```apgn -color COLOR -oskip OPENING_SKIP -depth DEPTH -threads THREADS /PATH/GAME1.pgn /PATH/GAME2.pgn```**
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](http://www.playwitharena.de/) and [PGN Viewer](https://chesstempo.com/pgn-viewer/) to better visualize your moves.