lichess.org
Donate

Programmers, please give advice (PGN, AI)

#1 Which programming language is best suited for working with chess PGN files?
For example, a code that will number all chess lines in a file in the classic form 1.1.1 (#3) and 1.1.4 (#6).
You can see the number of branches of sub-variants and the total number of variants.

#2 What platforms allow you to train bots or neural networks in chess or chess-related tasks?
For instance, create chess without kings. The goal is to take all the pieces.

P.S. I'm not even a beginner in programing :)
I don't fully understand what you like to do in #1, but I understand you'd like to do some work with strings. For that task I would try Python. Python is good at handling strings, although maybe not in the fastest way possible.
as not even beginner you are for a huge task. But even universities now mostly teach Python as a first programmin language and being intepreted allows easier "try and see" approach to programming.

And it also has everything. It has all possible modules you think of. To handle chess related you need install "chess" module which had interfaces for engines and PGN handling and quite bit more. is also well documented
python-chess.readthedocs.io/en/latest/

as for deep learning
pypi.org/project/keras/
is popular as it sort abstraction layer on top of few NN libraries
I would probably go the tensorflow directly but opiniond differ on this.

And full example what to do.
github.com/Vavart/othello-deep-learning
github.com/neoyung/connect-4

But honestly: Try first learning basic stuff on chosen language with sufficient exercises basic algorithms to develop correct way thinking about the problem . coding is not about knowing language but about knowing what you want to do in very detailed level and then the minor part is mapping that to a programming language.
#1, I'd use "Perl" but it's an old-timers language... it is, however, line-oriented and designed to process text and would be a natural choice for anyone familiar with it. It's a fairly intuitive and fun language to code in, except when it isn't ; )
@jlangelier said in #5:
> #1, I'd use "Perl" but it's an old-timers language... it is, however, line-oriented and designed to process text and would be a natural choice for anyone familiar with it. It's a fairly intuitive and fun language to code in, except when it isn't ; )

It pains me to disagree with you because I love Perl, but Python is definitely the way to go in this case because as #3 said, it has python-chess and many libraries for working with deep learning, including Keras and TensorFlow, but also others like PyTorch and SciKit-Learn. I haven't seen any better libraries for either working with chess games or deep learning in any other language.

Also, Python has generators which are awesome. ;-)

This topic has been archived and can no longer be replied to.