     /// The current halfmove clock.
     public var halfmoves: UInt {
         var n: UInt = 0
-        for (_, piece, capture) in _moveHistory.reverse() {
+        for (_, piece, capture, _) in _moveHistory.reverse() {
             if capture != nil { break }
             if case .Pawn = piece { break }
             n += 1

    public typealias PlayerTurn = Color

    /// All of the conducted moves in the game.
    private var _moveHistory: [(move: Move, piece: Piece, capture: Piece?)]

    /// All of the undone moves in the game.
    private var _undoHistory: [(move: Move, promotion: Piece?)]

    /// The game's board.
    public private(set) var board: Board

                board[rook][new] = true
            }
        }
        _moveHistory.append((move, piece, capture, attackersToKing))
        if let capture = capture {
            board[capture][captureSquare] = false
        }
