SteveBarnegren / SwiftChess

Chess engine and AI written in Swift
MIT License
145 stars 35 forks source link

PGN Parser #14

Closed yadav-anil92 closed 4 years ago

yadav-anil92 commented 5 years ago

How to use SwifChess with predefine PGN?

SteveBarnegren commented 4 years ago

Hi @yadav-anil92

Sorry for the delay in getting back to you.

If you can either write your own a PGN parser or find a pre-existing one, then this should be fairly easy to do. If you parse the PGN file to understand the move of the game, then you could create a 2 player game with SwiftChess, and instruct each player to make the moves as described in the PGN file.

SwiftChess doesn't provide any PGN support though, so you would need to provide that using a different library.