def grid_get_value(grid, x, y):  # Fonction renvoyant la valeur de la coordonnée x,y de la grille
    """
    Returns the value of the tile at coordinates (x,y). If the value is ' ', returns 0 instead.

    :param grid: The game grid
    :param x: X coordinate of the tile
    :param y: Y coordinate of the tile
    :return: grid[x][y], or 0 if grid[x][y] == ' '
    """
    if grid[x][y]== ' ':
        return 0
    else:
        return grid[x][y]