<prompt> Kuandika kazi ambayo huchukua tabia katika safu mbili-dimensional juu ya bodi ya mchezo  <response>: Heres one way you could write a function that moves a character across a two-dimensional array on a game board:pythondef move_characterboard, current_position, direction: This function moves a character across a two-dimensional array on a game board. :param board: 2D list representing the game board :param current_position: Tuple representing the current position of the character on the board row, col :param direction: String representing the direction in which to move the character up, down, left, right :return: Tuple representing the new position of the character on the board row, col Get the current row and column of the character row, col current_position Determine the new position of the character based on the direction given if direction up: row - 1 elif direction down: row 1 elif direction left: col - 1 elif direction right: col 1 else: raise ValueErrorInvalid direction Make sure the new position is within the bounds of the board row max0, minrow, lenboard - 1 col max0, mincol, lenboard0 - 1 Update the characters position on the board boardrowcol C Return the new position of the character return row, colThis function takes as input a 2D list representing the game board, a tuple representing the current position of the character on the board, and a string representing the direction in which to move the character. The function calculates the new position of the character based on the direction given, making sure that the new position is within the bounds of the board. It updates the characters position on the board to the new position, and then returns the new position as a tuple. 