as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a function that moves a character across a two-dimensional array on a game board
user
"""
function to move a character across a two-dimensional array on a game board
"""

def move_character(game_board, x, y):
    # check if out of bounds 
    if (x < 0 or x >= len(game_board[0]) or 
        y < 0 or y >= len(game_board)):
        print("out of bounds") 
        return 
    
    # update character 
    game_board[y][x] = 'c' 

    # print the updated game board 
    for row in game_board:
        print(" ".join(row))
assistant