def check_for_tree(map, width, pos):
    """
    Checks a position on the map for a tree
    :param map: List of string representing map
    :param pos: Position to check
    :return: 1 if there is a tree, 0 if not
    """
    x = pos[0] % width
    y = pos[1]
    if map[y] != '' and map[y][x] == '#':
        return 1
    return 0