+++ /dev/null
-#!/bin/bash
-
-start_letter=0
-line_number=0
-tree_count=0
-
-for line in $(<input.txt); do
- line_number=$((line_number+1))
- if [ $line_number -eq 1 ]; then
- continue
- fi
- start_letter=$((start_letter+3))
- if [ $start_letter -ge ${#line} ]; then
- start_letter=$((start_letter - ${#line}))
- fi
- if [ "${line:$start_letter:1}" = "#" ]; then
- tree_count=$((tree_count+1))
- fi
-done
-
-echo "Hit $tree_count trees"
-
-exit 0
-
-#!/usr/bin/python3
-
-trees_count = 0
-position = 3 # forth square in, we moved 3 right from where we were, 0 + 3 -> 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")