diff --git a/Sources/ChessKit/Bitboards/Bitboard.swift b/Sources/ChessKit/Bitboards/Bitboard.swift index 58a0931..d8a0271 100644 --- a/Sources/ChessKit/Bitboards/Bitboard.swift +++ b/Sources/ChessKit/Bitboards/Bitboard.swift @@ -23,7 +23,7 @@ extension Bitboard { static let dark: Bitboard = 0xAA55AA55AA55AA55 /// Bitboard representing all the light squares on the board. static let light: Bitboard = ~dark - + /// Translates the receiver `n` column "east" on an 8x8 grid. /// /// `n` should be in the range `[1, 7]`. @@ -91,7 +91,7 @@ extension Bitboard { /// - parameter labelRanks: Whether or not to label ranks (i.e. 1, 2, 3, ...). /// - parameter labelFiles: Whether or not to label ranks (i.e. a, b, c, ...). /// - returns: A string representing an 8x8 chess board. - /// + /// // periphery:ignore func chessString( _ occupied: Character = "⨯", diff --git a/Sources/ChessKit/Bitboards/PieceSet.swift b/Sources/ChessKit/Bitboards/PieceSet.swift index d0fa0e5..9e6c8af 100644 --- a/Sources/ChessKit/Bitboards/PieceSet.swift +++ b/Sources/ChessKit/Bitboards/PieceSet.swift @@ -182,7 +182,7 @@ extension PieceSet: CustomStringConvertible { let sq = Square(file, .init(rank)) if let piece = get(sq) { - s += " \(ChessKitConfiguration.printOptions.mode == .graphic ? piece.graphic : piece.fen)" + s += " \(ChessKitConfiguration.printOptions.mode == .graphic ? piece.graphic : piece.fen)" } else { s += " ·" } diff --git a/Sources/ChessKit/Board.swift b/Sources/ChessKit/Board.swift index c7603a6..eb84e7b 100644 --- a/Sources/ChessKit/Board.swift +++ b/Sources/ChessKit/Board.swift @@ -219,7 +219,7 @@ public struct Board: Sendable { processedMove.checkState = checkState positionHashCounts[position.hashValue, default: 0] += 1 - + if checkState == .checkmate { delegate?.didEnd(with: .win(move.piece.color)) } else if checkState == .stalemate { @@ -546,7 +546,7 @@ public struct Board: Sendable { let pathClear = castling.path.allSatisfy { set.get($0) == nil } - + let notCastlingThroughCheck = castling.squares.allSatisfy { attackers(to: $0.bb, set: set) & ~us == 0 } diff --git a/Sources/ChessKit/Clock.swift b/Sources/ChessKit/Clock.swift index 9d75dec..5dc565a 100644 --- a/Sources/ChessKit/Clock.swift +++ b/Sources/ChessKit/Clock.swift @@ -10,7 +10,7 @@ public struct Clock: Equatable, Sendable { /// The maximum number of half moves before /// a draw by the fifty move rule should be called. static let halfMoveMaximum = 100 - + /// The number of halfmoves, incremented after each move. /// It is reset to zero after each capture or pawn move. public var halfmoves = 0 diff --git a/Sources/ChessKit/Game.swift b/Sources/ChessKit/Game.swift index 2f39d64..308cad5 100644 --- a/Sources/ChessKit/Game.swift +++ b/Sources/ChessKit/Game.swift @@ -184,7 +184,7 @@ public struct Game: Equatable { /// - parameter index: The index of the move within the ``MoveTree``. /// - parameter assessment: The move assessment annotation. /// - parameter comment: The move comment annotation. - /// + /// public mutating func annotate( moveAt index: MoveTree.Index, assessment: Move.Assessment = .null, @@ -234,7 +234,7 @@ extension Game { /// Contains the PGN tag pairs for a game. public struct Tags: Equatable { - /// Whether or not all the standard mandatory tags for + /// Whether or not all the standard mandatory tags for /// PGN archival are set. /// /// These include `event`, `site`, `date`, `round`, @@ -258,7 +258,7 @@ extension Game { /// where "COUNTRY" is the three-letter International Olympic Committee /// code for the country. /// - /// Although not part of the specification, some online chess platforms + /// Although not part of the specification, some online chess platforms /// will include a URL or website as the site value. @Tag(name: "Site") public var site: String @@ -289,7 +289,7 @@ extension Game { @Tag(name: "Black") public var black: String - /// Result of the game. + /// Result of the game. /// /// Example: `"1/2-1/2"` /// @@ -338,7 +338,7 @@ extension Game { /// /// The key will be used as the tag name in the PGN. public var other: [String: String] = [:] - + /// Initializes a `Game.Tags` object with the provided /// values. /// diff --git a/Sources/ChessKit/Parsers/PGNParser+Regex.swift b/Sources/ChessKit/Parsers/PGNParser+Regex.swift index d299000..06affb9 100644 --- a/Sources/ChessKit/Parsers/PGNParser+Regex.swift +++ b/Sources/ChessKit/Parsers/PGNParser+Regex.swift @@ -4,13 +4,13 @@ // extension PGNParser { - + /// Contains useful regex strings for PGN parsing. struct Pattern { // tag pair components static let tags = #"\[[^\]]+\]"# static let tagPair = #"\[([^"]+?)\s"([^"]+)"\]"# - + // move text static let moveText = #"\d{1,}\.{1,3}\s?(([Oo0]-[Oo0](-[Oo0])?|[KQRBN]?[a-h]?[1-8]?x?[a-h][1-8](\=[QRBN])?[+#]?)([\?!]{1,2})?(\s?\$\d)?(\s?\{.+?\})?(\s(1-0|0-1|1\/2-1\/2))?\s?){1,2}"# static let moveNumber = #"^\d{1,}"# diff --git a/Sources/ChessKit/Piece.swift b/Sources/ChessKit/Piece.swift index 86d3278..aad42a7 100644 --- a/Sources/ChessKit/Piece.swift +++ b/Sources/ChessKit/Piece.swift @@ -103,7 +103,7 @@ public struct Piece: Equatable, Hashable, Sendable { case (.white, .king): "K" } } - + var graphic: String { switch (color, kind) { case (.black, .pawn): "♟\u{FE0E}" diff --git a/Sources/ChessKit/Special Moves/EnPassant.swift b/Sources/ChessKit/Special Moves/EnPassant.swift index 4fe2ed2..01f6b21 100644 --- a/Sources/ChessKit/Special Moves/EnPassant.swift +++ b/Sources/ChessKit/Special Moves/EnPassant.swift @@ -13,7 +13,7 @@ struct EnPassant: Equatable, Hashable, Sendable { var captureSquare: Square { Square(pawn.square.file, pawn.color == .white ? 3 : 6) } - + /// Determines whether or not the pawn could be captured by en passant. /// /// - parameter capturingPiece: The piece that is capturing the contained pawn.