Files
chesskit-engine/README.md
T
Paolo Di Lorenzo eab5c12ea5 Improve readme
2023-04-15 11:41:17 -04:00

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 ChessKitEngine to 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()
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

@pdil

License

ChessKitEngine is distributed under the MIT License.