swift-chess

1.0.8

Chess represented in swift
dpedley/swift-chess

What's New

Release 1.0.8

2021-01-07T04:03:16Z

This is the version for the initial app store release.

Chess

This package provides UI components and game logic for standard chess play.

The code presents a unified pattern for the game interactions using Combine and SwiftUI. A chess game, the board, players etc are all housed in a ChessStore

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 SquareTargeted.swift.

When a user taps a square we show the possible moves on the board.

TODO: This readme should have a better ending.

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

Last updated: Tue Nov 05 2024 04:56:27 GMT-1000 (Hawaii-Aleutian Standard Time)