def bishop_take_test(): print("========================================") print("Performing the bishop take test") print("========================================") board = Board() piece = Bishop(Colour.WHITE) current_location = Location('c', 3) board.__add_piece__(piece, current_location) friend_piece = Pawn(Colour.WHITE) enemy_piece = Pawn(Colour.BLACK) board.__add_piece__(friend_piece, Location('b', 2)) board.__add_piece__(enemy_piece, Location('d', 4)) print("Added a Bishop and 2 pawns to the board...") print(board) allowed_moves = piece.allowed_moves(current_location, board) print("For a {} {} starting at position {} the moves are:".format( piece.colour, piece.name, current_location)) print(allowed_moves) new_location = allowed_moves[0] board.move_piece(piece, current_location, new_location) current_location = new_location print("Moved the {} to position {}".format(piece.name, new_location)) print(board) print("For a {} {} at position {} the moves are:".format( piece.colour, piece.name, current_location)) print(piece.allowed_moves(current_location, board))
def basic_bishop_test(): print("========================================") print("Performing the basic bishop movement test") print("========================================") board = Board() piece = Bishop(Colour.WHITE) current_location = Location('d', 5) board.__add_piece__(piece, current_location) print(board) allowed_moves = piece.allowed_moves(current_location, board) print("For a {} {} starting at position {} the moves are:".format( piece.colour, piece.name, current_location)) print(allowed_moves) new_location = allowed_moves[0] board.move_piece(piece, current_location, new_location) current_location = new_location print("Moved the {} to position {}".format(piece.name, new_location)) print(board) print("For a {} {} at position {} the moves are:".format( piece.colour, piece.name, current_location)) print(piece.allowed_moves(current_location, board))