FischerCore
is a Swift library that encapsulates the core logic and data structures necessary for building chess games.
Named in honor of the legendary chess grandmaster Bobby Fischer, this library provides a comprehensive foundation for creating, managing, and enforcing the rules of chess
You can use FischerCore
in your project by adding it as a dependency in your Package.swift
file:
.package(url: "https://github.com/NSStudent/fischer-core.git", from: "0.1.0")
Then, add "FischerCore"
to your target's dependencies:
.target(
name: "YourTarget",
dependencies: [
.product(name: "FischerCore", package: "fischer-core")
]
)
The API reference and detailed documentation for FischerCore
is available at:
👉 https://nsstudent.dev/fischer-core/documentation/fischercore/
This library is based on the code of other well-crafted chess engines and bitboard libraries in Swift. Notably, it builds upon the work in Sage by @nvzqz, adapting and updating it to be compatible with the current state of the Swift language and modern development practices.
Special thanks to Point-Free for their fantastic swift-parsing library, which greatly simplified the implementation of our PGN parser.
The following features are planned to improve the functionality and completeness of FischerCore
:
- Support additional PGN comment types (e.g. clock time, evaluation, annotations).
- Add performance benchmarks for parsers and move generation.
- Improve FEN parsing using a unified parser approach.
The following core features are already available:
Bitboard
: Efficient low-level representation of board state using bitwise operations.Game
: Rule-enforced move execution, undo functionality, outcome detection, and full board state management.PGN parsing
: Conversion of PGN text into structured data with support for tags, comments, and moves.Move
: Encapsulates move logic with origin and destination squares, and supports conversion fromSANMove
to drive game mechanics.