X-Git-Url: https://git.sommitrealweird.co.uk/advent-of-code-2020.git/blobdiff_plain/a2ce7bb47964e226d4b10b791a038ca1f1fa67d7:/day3/count_trees.sh..fe0197cb1dc8f701b69ce52b9acb445351557c8d:/day03/static/gitweb.js?ds=sidebyside diff --git a/day3/count_trees.sh b/day3/count_trees.sh deleted file mode 100644 index 53925a3..0000000 --- a/day3/count_trees.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -start_letter=0 -line_number=0 -tree_count=0 - -for line in $( 3 -on_first_line = True -line_number = 0 - -for line in open("input.txt", "r"): - line_number += 1 - print("line: ", line_number) - line = line.rstrip() - print(line) - if on_first_line: - on_first_line = False - continue - print(line[position], position) - if line[position] == "#": - trees_count += 1 - print("hit tree") - else: - print("missed tree") - # now add 3 to the position - position += 3 - if position >= len(line): - position = position - len(line) - -print("There were", trees_count, "trees")