def render_2d(game: dict, xray: bool = False) -> list:
    """
    Create a string representation of the board.

    Makes a list of lists, representing a 2d matrix, of strings corresponding
    to the tile values of the game['board']. '.' denotes a bomb, '_' denotes
    a hidden tile, ' ' denotes an empty revealed tile, and then number strings
    are for revealed tiles with numbers.

    Parameters
    ----------
    game : dict
        A game dictionary containing dimensions, game, state, and mask keys.
    xray : bool, optional
        Option to reveal all hidden tiles. The default is False and thus only
        the tiles allowed by game['mask'] are revealed, the rest are '_'.

    Returns
    -------
    render : list
        A list of lists of strings representing the game board that is more
        fit to print.

    """
    render = []
    for i in range(len(game["mask"])):  # Iterate over the rows.
        row = []
        for j in range(len(game["mask"][i])):  # Iterate over columns
            if game["mask"][i][j] is False and xray is False:
                row.append("_")  # Hidden tile
            else:
                tile = game["board"][i][j]
                if tile == 0:
                    row.append(" ")  # Empty tile
                else:
                    row.append(str(tile))
        render.append(row)
    return render