Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBarnegren committed Apr 2, 2017
2 parents 88dda59 + b8ed2b3 commit 16c757f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Example/Tests/BoardTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class BoardTests: XCTestCase {
(56, .rook, .black),
(57, .knight, .black),
(58, .bishop, .black),
(59, .king, .black),
(60, .queen, .black),
(59, .queen, .black),
(60, .king, .black),
(61, .bishop, .black),
(62, .knight, .black),
(63, .rook, .black),
Expand Down Expand Up @@ -754,7 +754,7 @@ class BoardTests: XCTestCase {

func createPerformCastleBoard() -> Board {

let board = ASCIIBoard(pieces: "r - - g - - - r" +
let board = ASCIIBoard(pieces: "r - - - g - - r" +
"p p p p p p p p" +
"- - - - - - - -" +
"- - - - - - - -" +
Expand Down Expand Up @@ -787,16 +787,16 @@ class BoardTests: XCTestCase {

var board = createPerformCastleBoard()
board.performCastle(color: .black, side: .kingSide)
XCTAssert(board.getPiece(at: BoardLocation(x: 1, y: 7))?.type == .king)
XCTAssert(board.getPiece(at: BoardLocation(x: 2, y: 7))?.type == .rook)
XCTAssert(board.getPiece(at: BoardLocation(x: 6, y: 7))?.type == .king)
XCTAssert(board.getPiece(at: BoardLocation(x: 5, y: 7))?.type == .rook)
}

func testBlackQueenSideCastleUpdatesPiecePositions() {

var board = createPerformCastleBoard()
board.performCastle(color: .black, side: .queenSide)
XCTAssert(board.getPiece(at: BoardLocation(x: 5, y: 7))?.type == .king)
XCTAssert(board.getPiece(at: BoardLocation(x: 4, y: 7))?.type == .rook)
XCTAssert(board.getPiece(at: BoardLocation(x: 2, y: 7))?.type == .king)
XCTAssert(board.getPiece(at: BoardLocation(x: 3, y: 7))?.type == .rook)
}

// MARK: - Check hasMoved flag isn't accidentally set
Expand Down
2 changes: 1 addition & 1 deletion SwiftChess.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SwiftChess'
s.version = '0.1.0'
s.version = '0.1.1'
s.summary = 'Chess engine written in Swift'

# This description is used to generate tags and improve search results.
Expand Down
2 changes: 2 additions & 0 deletions SwiftChess/Source/Board.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public struct Board : Equatable {

if enPassentPiece.canBeTakenByEnPassant && enPassentPiece.color == movingPiece.color.opposite() {
squares[enPassentLocation.index].piece = nil;
let operation = BoardOperation(type: .removePiece, piece: enPassentPiece, location: enPassentLocation)
operations.append(operation)
}
}

Expand Down

0 comments on commit 16c757f

Please sign in to comment.