Minor refactor start
[advent-of-code-2019.git] / day10 / check_asteroids.sh
index bf545445e8b9852429a3a65902836ea59d20e5de..efda3592252571b2e69c873d55c446fa4563cc11 100755 (executable)
@@ -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