EndgameCore is a pure Swift chess library. The goal of this library is to make writing chess application as easy as possible. As of now the library supports PGN parsing and move generation.
- PGN Decoding
- PGN Encoding
- FEN Decoding
- FEN Encoding
If you are using Xcode 11 or later:
- On an Xcode project click File
- Swift Packages
- Add Package Dependency
- Specify the git URL for for EndgameCore
https://github.com/Jelizondo/EndgameCore
.
Decoding from a file:
let pgn = PGNDecoder().decode(fileName: "file.pgn", bundle: .main)
Decoding from a string:
let pgn = PGNDecoder().decode(rawValue: PGNRaw)
Initialize a game from a pgn:
guard let game = Game(pgn: pgn) else {
// Unable to create game from pgn
}