def get_surrounding(field, row, col, value):
    """Finds how many mines are in surrounding squares of a certain coordinate"""
    count = 0
    # checks surrounding squares
    for i in range(row - 1, row + 2):
        for k in range(col - 1, col + 2):
            # checks if the current coordinate is on the field and is the value
            if 0 <= i < field.shape[0] and 0 <= k < field.shape[1] and field[i, k] == value:
                count += 1
    return count