def check_perception(thoughts, init_board, game_type):
    """
    Check if model's perception matches the initial board.

    Compares the model's understanding of the initial state with the actual initial state,
    with game-specific adjustments for different puzzle types.

    Args:
        thoughts (list): 2D array representing the model's perception of the initial state
        init_board (list): 2D array representing the actual initial state
        game_type (str): Type of puzzle game
    Returns:
        bool: True if perception matches initial board, False otherwise
    """
    # Game-specific adjustments
    if game_type == "battleships":
        init_board = [[0 if cell == 'e' else cell for cell in row] for row in init_board]
        thoughts = [[0 if cell == 'e' else cell for cell in row] for row in thoughts]
    if game_type == "lightup":
        for i in range(len(init_board)):
            for j in range(len(init_board[i])):
                cell = init_board[i][j]
                # Check if cell is a number (not 0) or not a string/character
                if (isinstance(cell, (int, float)) and cell != 0) or (isinstance(cell, str) and not cell.isalpha()):
                    init_board[i][j] = 'w'
    if game_type == "fieldexplore":
        # Convert -1 to 0 in init_board
        init_board = [[0 if cell == -1 else cell for cell in row] for row in init_board]
    # Convert string representation to 2D grid if needed
    if isinstance(init_board, str):
        init_grid = [[c for c in row] for row in init_board.strip().split('\n')]
    else:
        init_grid = init_board

    # Check dimensions match
    if len(thoughts) != len(init_grid) or any(len(row) != len(init_grid[0]) for row in thoughts):
        return False
    # Check cell by cell
    for i in range(len(init_grid)):
        for j in range(len(init_grid[0])):
            if str(init_grid[i][j]) != str(thoughts[i][j]):
                return False
    return True

    Check if model's perception matches the initial board.

    Compares the model's understanding of the initial state with the actual initial state,
    with game-specific adjustments for different puzzle types.

    Args:
        thoughts (list): 2D array representing the model's perception of the initial state
        init_board (list): 2D array representing the actual initial state
        game_type (str): Type of puzzle game
    Returns:
        bool: True if perception matches initial board, False otherwise
    
vlmeval/dataset/utils/vgrpbench/score.py