Swiftpack.co - aperechnev/ChessKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
aperechnev/ChessKit
Lightweight and fast chess framework written in Swift.
.package(url: "https://github.com/aperechnev/ChessKit.git", from: "1.3.6")

ChessKit

codebeat badge docs badge Tests ChessKit pod

Lightweight and fast chess framework written in Swift.

ChessKit is used as a base framework for Ladoga chess engine.

Installation

The ChessKit framework is avalable for installation via Swift Package Manager and CocoaPods.

Swift Package Manager

Add a dependency via Xcode, 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: "1.2.10"),
    ],
    targets: [
        .target(name: "MyPackage", dependencies: ["ChessKit"]),
    ]
)

CocoaPods

To install ChessKit via CocoaPods, just add a dependencie to your Podfile:

target 'MyApp' do
  pod 'ChessKit'
end

Gettings Started

ChessKit is well covered by documentation. But anyway here you can find an example describing how to start working with ChessKit faster.

import ChessKit

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

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

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

game.make(move: Move(string: "c5b4"))
let evansGambitAcceptedFen = FenSerialization.default.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())")

How To Contribute

Please follow the git-flow notation and make sure that all tests are passing before contributing. Your questions and pull requests are welcome.

Versioning

We are using semantic versioning.

License

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

GitHub

link
Stars: 4
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

26 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics