- 1.0.8 and main188.8.131.52.04.2
- 1.0.8 and mainiOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
Chess represented in swift
You can find an example Xcode project in the "PlayChess" folder.
This app is also available in the App Store if you'd like to try it.
The main starting place for using
swift-chess is the ChessStore
It houses a chess game, its board, and players. It provides the game and environment interface via a reducer pattern.
Here's an example of creating a ChessStore that would allow two people to play.
let white = Chess.HumanPlayer(side: .white) let black = Chess.HumanPlayer(side: . black) let game = Chess.Game(white, against: black) let store = ChessStore(game: game)
You might then use the store as the environment variable for a BoardView.
There is a lot to discover, you will find previews in the code, this can be helpful to get a visual guide.
Here's XCode showing the preview of
When a user taps a square we show the possible moves on the board.
Find a bug? Need help w/ the docs?
If you have a question about the App Store version, you can find more info at chess.toys