X-Git-Url: https://git.sommitrealweird.co.uk/advent-of-code-2019.git/blobdiff_plain/208278a116710606095215db716ec2e1c99855cb..8559cc01c88addff1e3970519775d08c121ce5bf:/day10/check_asteroids.sh diff --git a/day10/check_asteroids.sh b/day10/check_asteroids.sh index bf54544..efda359 100755 --- a/day10/check_asteroids.sh +++ b/day10/check_asteroids.sh @@ -5,6 +5,8 @@ set -e basedir=$(dirname $(readlink -f ${BASH_SOURCE})) +. $basedir/common.sh + filename=${1:-$basedir/3_4_8.txt} exec 3<$filename @@ -37,18 +39,6 @@ debug_line() { echo "$line" >&2 } -get_vector() { - local x1=$1 - local y1=$2 - local x2=$3 - local y2=$4 - - x_diff=$(($x1 - $x2)) - y_diff=$(($y1 - $y2)) - - echo "$x_diff,$y_diff" -} - check_collision() { # we want to know if vector2 is going to get in the way of vector1 local vector1=$1