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