7 for line in $(<input.txt); do
8 line_number=$((line_number+1))
9 if [ $line_number -eq 1 ]; then
12 start_letter=$((start_letter+3))
13 if [ $start_letter -ge ${#line} ]; then
14 start_letter=$((start_letter - ${#line}))
16 if [ "${line:$start_letter:1}" = "#" ]; then
17 tree_count=$((tree_count+1))
21 echo "Hit $tree_count trees"
28 position = 3 # forth square in, we moved 3 right from where we were, 0 + 3 -> 3
32 for line in open("input.txt", "r"):
34 print("line: ", line_number)
40 print(line[position], position)
41 if line[position] == "#":
46 # now add 3 to the position
48 if position >= len(line):
49 position = position - len(line)
51 print("There were", trees_count, "trees")