mirror of
https://github.com/chesskit-app/chesskit-engine.git
synced 2026-05-19 15:50:35 +00:00
1.5 KiB
1.5 KiB
🤖 ChessKitEngine
A Swift package for chess engines.
ChessKitEngine implements the Universal Chess Interface protocol for communication between chess engines and user interfaces built with Swift.
Usage
- Add a package dependency to your Xcode project or Swift Package:
.package(url: "https://github.com/chesskit-app/chesskit-engine", from: "0.1.0")
- Next you can import
ChessKitEngineto use it in your Swift code:
import ChessKitEngine
// ...
Features
- Initialize an engine and set response handler
let engine = Engine(type: .stockfish)
// set response handler
engine.receiveResponse = { response in
print(response)
}
engine.start()
- Send UCI protocol commands
import ChessKit
let position = Position()
if engine.isRunning {
engine.send(command: .stop)
engine.send(command: position)
engine.send(command: .go(depth: 15))
}
- Terminate engine communication
engine.stop()
Supported Engines
The following engines are currently supported:
Author
License
ChessKitEngine is distributed under the MIT License.