Released Thursday, October 3, 2024.
BoardDelegate
now notifies when king is in check, and provides the color of the checked king, see Issue #38.Move.checkState
andMove.disambiguation
are now publicly accessible, see Issue #38.
- Enable Swift 6 language mode package-wide.
Game
andMoveTree
are nowSendable
types.
Released Wednesday, September 11, 2024.
- Fix
MoveTree.fullVariation(for:)
returning blank array when.minimum
is passed as the index.- If this index is passed, it will automatically start from the next (valid) index and return the moves for that index.
- In practice this will mean the main variation will be returned (starting from white's first move).
Released Wednesday, August 21, 2024.
- Conform more types to
Hashable
such asGame
andMoveTree
. Game.Tag
now publicly exposesname
.Game.Tags
is nowHashable
andSendable
.
Released Monday, August 5, 2024.
- A draw result is now published by
BoardDelegate
when the board encounters a threefold repetition (by @joee-ca). - Convenience directional properties added to
Square
such asup
,down
,left
, andright
to obtain squares in relation to the givenSquare
.
File.init(_ number: Int)
now correctly bounds invalid values.- i.e. Values less than 1 become
File.a
and values greater than 8 becomeFile.h
.
- i.e. Values less than 1 become
- Test coverage has been improved.
- Parsers (
EngineLANParser
,FENParser
,PGNParser
,SANParser
) have been converted from classes to caseless enums.- This should have no effect on existing code since the class versions had private initializers.
Released Friday, June 21, 2024.
- Update tools version to Swift 5.9 (requires Xcode 15.0 or greater).
- Conform to Swift strict concurrency and add
Sendable
conformance to most objects
Game
is now astruct
and no longer conforms toObservableObject
.- If observation semantics are required, consider using
didSet
property observers or an object that utilizes the@Observable
macro.
- If observation semantics are required, consider using
Released Saturday, June 15, 2024.
MoveTree
now conforms toBidirectionalCollection
, allowing for more standard collection-based semantics in Swift.- Should not affect any existing functionality or API usage.
- Several methods on
MoveTree
have been deprecated in favor of theirCollection
counterparts:previousIndex(for:)
→index(before:)
/hasIndex(before:)
nextIndex(for:)
→index(after:)
/hasIndex(after:)
move(at:)
→subscript(_:)
(e.g.tree[index]
)
MoveTree.annotate()
now optionally returns theMove
object after annotation.MoveTree.path()
now returns tuple with named parameters (direction
andindex
).
- Removed
CustomDebugStringConvertible
conformance fromBitboard
to avoid affecting allUInt64
debug prints.- To print the string representation of
Bitboard
useBitboard.chessString()
.
- To print the string representation of
Released Friday, June 7, 2024.
- Add support for draw by insufficient material (by @joee-ca).
- Once this condition is reached
.draw(.insufficientMaterial)
will be published via theBoardDelegate.didEnd(with:)
method.
- Once this condition is reached
- Add unicode variant selector when printing black pawn icon to avoid displaying emoji (by @joee-ca).
- Fix issue where king could castle through other pieces (by @TigranSaakyan).
Released Monday, May 6, 2024.
- Fix
MoveTree.previousIndex(for:)
when provided index is one afterminimumIndex
.
Released Monday, April 29, 2024.
- Add
startingIndex
andstartingPosition
toGame
.startingIndex
takes into account thesideToMove
ofstartingPosition
.
- Fix rare en passant issue that could allow the king to be left in check, see Issue #18.
Released Friday, April 19, 2024.
- Enable
chesskit-swift
to run on oldest platform possible without code changes.- Now works on iOS 13+, macOS 10.15+, tvOS 13+, watchOS 6+.
- Annotations on moves in the
MoveTree
can now also be updated viaGame.annotate(moveAt:assessment:comment:)
.
- Fix
MoveTree
not properly publishing changes viaGame
. - Fix
Board.EndResult.repetition
spelling.- This isn't made available yet but will be implemented in an upcoming release.
Released Sunday, April 14, 2024.
- PGN parsing now supports tag pairs (for example
[Event "Name"]
) located at the top of the PGN format, see Issue #8.
- Fix issue where king is allowed to castle in check, see Issue #11.
- Remove
color
parameter fromMove.init(san:color:position:)
initializer.- It was not being used, can be removed from any initializer call where it was included.
- The new initializer is simply
Move.init(san:position:)
.
Released Saturday, April 13, 2024.
Board
move calculation and validation performance has greatly increased.- Performance has improved by over 250x when simulating a full game using
Board
. - Underlying board representation has been replaced with much faster bitboard structures and algorithms.
- Performance has improved by over 250x when simulating a full game using
- Add
CustomStringConvertible
conformance toBoard
andPosition
to allow for printing chess board representations, useful for debugging. - Add
ChessKitConfiguration
with static configuration properties for the package.- Currently the only option is
printMode
to determine how pieces should be represented when printingBoard
andPosition
objects (see previous item).
- Currently the only option is
EnPassant
has been made aninternal struct
. It is used interally byPosition
andBoard
.
Position.toggleSideToMove()
is now private and handled automatically when callingmove()
. The public-facingtoggleSideToMove()
has been deprecated.
Released Saturday, December 2, 2023.
- Made
file
andrank
public properties ofSquare
.
Released Friday, November 24, 2023.
- Add
CaseIterable
conformance to severalPiece
andSquare
enums:Piece.Color
Piece.Kind
Square.Color
Released Wednesday, June 21, 2023.
- Add
future(for:)
andfullVariation(for:)
methods toMoveTree
.future(for:)
returns the future moves for a given index.fullVariation(for:)
returns the sum ofhistory(for:)
andfuture(for:)
.
- Simplify
PGNElement
to just contain a single.move
case.- i.e.
.whiteMove
andblackMove
have been removed and consolidated.
- i.e.
- Fix behavior of
previousIndex(for:)
andnextIndex(for:)
inMoveTree
.- Especially when the provided
index
is equal to.minimum
.
- Especially when the provided
Released Wednesday, May 31, 2023.
-
MoveTree
andMoveTree.Index
objects to track move turns and variations.Game.moves
is now aMoveTree
object instead of[Int: MovePair]
MoveTree.Index
includes piece color and variation so it can be used to directly identify any single move within a game- Use the properties and functions of
MoveTree
to retrieve moves within the tree as needed
-
make(move:index:)
andmake(moves:index:)
with ability to make moves onGame
with SAN strings for convenience- For example:
game.make(moves: ["e4", "e5"])
- For example:
-
PGNParser.convert(game:)
now returns the PGN string for a given game, including variations.- Note:
PGNParser.parse(pgn:)
still does not work with variations, this is coming in a future update.
- Note:
-
Game.positions
is now public- Contains a dictionary of all positions in the game by
MoveTree.Index
, including variations
- Contains a dictionary of all positions in the game by
Game.annotateMove
- Modify
Move.assessment
andMove.comment
directly instead
- Modify
MovePair
- Use
Move
in conjuction withMoveTree.Index
to track move indicies
- Use
color
parameter fromSANParser.parse()
- The color is now obtained from the
sideToMove
in the providedposition
- The color is now obtained from the
Released Thursday, May 11, 2023.
- Add documentation for all public members
- Add default starting position for
Game
initializer - Add ability to annotate moves via
Game
Released Wednesday, April 12, 2023.
- Downgrade required Swift version to 5.7
- Allows use with Xcode 14.2 on GitHub Actions
Released Tuesday, April 11, 2023.
- Initial release