X-Git-Url: https://git.sommitrealweird.co.uk/advent-of-code-2020.git/blobdiff_plain/a2ce7bb47964e226d4b10b791a038ca1f1fa67d7..fe0197cb1dc8f701b69ce52b9acb445351557c8d:/day3/count_trees_2.py?ds=sidebyside diff --git a/day3/count_trees_2.py b/day3/count_trees_2.py deleted file mode 100644 index 84a3883..0000000 --- a/day3/count_trees_2.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/python3 - -trees_count = [] -on_first_line = True -line_number = 0 - -move_types = ((1,1), (3,1), (5,1), (7,1), (1,2)) - -for move in move_types: - line_offset = 0 - tree_count = 0 - position = move[0] - first_line = True - for line in open("input.txt", "r"): - line = line.rstrip() - print(move[1], line_offset) - if line_offset < move[1] or first_line: - line_offset += 1 - if line_offset >= move[1]: - first_line = False - continue - line_offset = 1 - if line[position] == "#": - tree_count += 1 - position += move[0] - if position >= len(line): - position = position - len(line) - trees_count.append(tree_count) - tree_count = 0 - -mult_result = 1 -for x in trees_count: - print(x) - mult_result *= x - -print("There were", mult_result, "trees")