def getTestBoard2(): chessBoard = pychess.ChessBoard() board = [] for i in range(0, 8): row = [] for j in range(0, 8): row.append(None) board.append(row) board[0][0] = pychess.Rook(pychess.Color.BLACK) board[0][4] = pychess.King(pychess.Color.BLACK) board[7][3] = pychess.King(pychess.Color.WHITE) chessBoard.setBoard(board) return chessBoard
def test_chessboard_applymove3(self): testBoard = getTestBoard5() testMove = pychess.Move(pychess.Position(0, 0), pychess.Position(0, 1)) testBoard.applyMove(testMove) board1 = testBoard.board board2 = [] for i in range(0, 8): row = [] for j in range(0, 8): row.append(None) board2.append(row) board2[0][1] = pychess.King(pychess.Color.BLACK) board2[7][0] = pychess.Rook(pychess.Color.WHITE) board2[7][7] = pychess.King(pychess.Color.WHITE) self.assertTrue(compareBoards(board1, board2))
def getTestBoard3(): chessBoard = pychess.ChessBoard() board = [] for i in range(0, 8): row = [] for j in range(0, 8): row.append(None) board.append(row) board[0][4] = pychess.King(pychess.Color.BLACK) board[7][3] = pychess.King(pychess.Color.WHITE) board[4][4] = pychess.Pawn(pychess.Color.BLACK) board[4][4].hasMoved = True board[4][3] = pychess.Pawn(pychess.Color.WHITE) board[4][3].hasMoved = True board[4][3].hasSecondMoved = True board[4][5] = pychess.Pawn(pychess.Color.WHITE) chessBoard.setBoard(board) return chessBoard
def getTestBoard1(): chessBoard = pychess.ChessBoard() board = [] for i in range(0, 8): row = [] for j in range(0, 8): row.append(None) board.append(row) board[1][4] = pychess.King(pychess.Color.BLACK) board[2][5] = pychess.Pawn(pychess.Color.WHITE) board[3][0] = pychess.Pawn(pychess.Color.WHITE) board[3][2] = pychess.Rook(pychess.Color.BLACK) board[3][7] = pychess.Pawn(pychess.Color.BLACK) board[4][4] = pychess.Bishop(pychess.Color.BLACK) board[5][0] = pychess.Pawn(pychess.Color.BLACK) board[5][3] = pychess.Queen(pychess.Color.BLACK) board[5][6] = pychess.Knight(pychess.Color.BLACK) board[6][1] = pychess.Pawn(pychess.Color.WHITE) board[7][5] = pychess.Pawn(pychess.Color.WHITE) board[7][7] = pychess.Pawn(pychess.Color.WHITE) chessBoard.setBoard(board) return chessBoard