def main():
    input_file_name = "day3input.txt"

    with open(input_file_name) as input_file:
        directions = input_file.read()

    current_position = 0, 0
    history = []
    history.append(current_position)

    for direction in directions:
        if direction is '^':
            current_position = current_position[0], current_position[1] + 1
        if direction is 'v':
            current_position = current_position[0], current_position[1] - 1
        if direction is '<':
            current_position = current_position[0] - 1, current_position[1]
        if direction is '>':
            current_position = current_position[0] + 1, current_position[1]
        if current_position not in history:
            history.append(current_position)

    print('Unique houses visited: ' + str(len(history)))

if __name__ == '__main__':
    main()
