ChessKit

2.0.0

Lightweight and fast chess framework written in Swift.
aperechnev/ChessKit

What's New

2.0.0

2025-09-30T22:51:13Z
  • Updated Swift Tools to version 6.1.
  • Removed the default field from several classes to meet the requirements of Swift 6.0 and higher:
    • FenSerialization.default
    • Rays.default
    • MovingTranslations.default
    • SanSerialization.default
  • Migrated tests from XCTest to the modern Testing framework.
  • Migrated documentation from Jazzy to DocC.
  • Removed CocoaPods support.

ChessKit

Tests

A lightweight and fast chess framework written in Swift.

ChessKit is a core library used in Ladoga chess engine.

Installation

ChessKit framework is avalable for installation via Swift Package Manager.

Add a dependency to the Xcode project by linking to https://github.com/aperechnev/ChessKit, or directly in your Package.swift file:

import PackageDescription

let package = Package(
    name: "MyPackage",
    platforms: [
        .macOS(.v10_12),
    ],
    dependencies: [
        .package(url: "https://github.com/aperechnev/ChessKit.git", from: "2.0.0"),
    ],
    targets: [
        .target(name: "MyPackage", dependencies: ["ChessKit"]),
    ]
)

Getting Started

ChessKit is well covered by documentation. However, here you can find an example that describes how to start working with ChessKit.

import ChessKit

let fenSerializer = FenSerialization()
let italianGameFen = "r1bqk1nr/pppp1ppp/2n5/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4"
let italianGamePosition = fenSerializer.deserialize(fen: italianGameFen)
let game = Game(position: italianGamePosition)

print("Number of available moves: \(game.legalMoves.count)")

game.make(move: "b2b4")
let evansGambitFen = fenSerializer.serialize(position: game.position)
print("Evans gambit fen: \(evansGambitFen)")

game.make(move: Move(string: "c5b4"))
let evansGambitAcceptedFen = fenSerializer.serialize(position: game.position)
print("Evans gambit accepted fen: \(evansGambitAcceptedFen)")

print("List of moves in game: \(game.movesHistory)")
print("List of pieces on board: \(game.position.board.enumeratedPieces())")

Versioning

We use semantic versioning.

License

ChessKit is released under the MIT license. See LICENSE for details.

Description

  • Swift Tools 6.1.0
View More Packages from this Author

Dependencies

Last updated: Fri Oct 31 2025 02:36:25 GMT-0900 (Hawaii-Aleutian Daylight Time)