Simple algorithm to use:
- (terminal) git clone https://github.com/DrShams/chess_ai_battle
- (terminal) cd chess_ai_battle
test.pgn file wil be final output file which will be used further.
- At first download chess engines from official websites: https://stockfishchess.org/download/ and https://komodochess.com/
- (terminal) py chess_to_db.py
- in my case, here I used stockfish_20090216_32bit.exe and komodo-12.1.1-32bit.exe
- Enter the number of chess game you want to store in database:
- for instance: 100
- in the file chessdb.sqlite will be added 100 games with SAN notation of the games
- check https://en.wikipedia.org/wiki/Algebraic_notation_(chess)
- in any time you can interrupt that script with Ctrl+C
- (terminal) py chess_db_to_pgn.py
- that script converts games from database chessdb.sqlite to test.pgn file
- move test.pgn file to the pgnstats folder
- (terminal) cd pgnstats
III. Install https://golang.org/ and use goLang script to convert test.pgn to "youname".json file,
Usage example:
- (terminal) go run . -f test.pgn -o test.json
or
-
(terminal) go run pgnstats.go Gamestats.go Heatmap.go file.go movetrack.go openingmove.go getstats.go stats.go -f test.pgn -o test.json
-
move that .json file in the previous (chess_ai_battle) folder
-
(terminal) cd chess_ai_battle
- install https://nodejs.org/en/
- (terminal) npm install http-server -g
- (terminal) http-server -p 8000 --cors (that launches http-server with open port 8000 with cross-origin resource sharing, it needs for bypass d3.json browser security function which are the part of chess_2.html file)
(here will be sunburst visualisation of all the games from PGN.file, you can use any PGN.file for that purpose)
Notes:
- that project is incomplete so if you find some mistakes let me know
Contributions:
- https://github.com/ebemunk/chess-dataviz
- https://github.com/ebemunk/pgnstats
- also huge thanks Fr3nch for making corrections and advices