diff --git a/day10.cr b/day10.cr index 13641f2..cb11d7c 100644 --- a/day10.cr +++ b/day10.cr @@ -12,10 +12,6 @@ struct Tuple(*T) def -(other) {self[0]-other[0], self[1] - other[1]} end - - def dist - self[0] + self[1] - end end input = input(2019, 10) @@ -53,7 +49,7 @@ end angle_groups.delete({0,0}) angle_groups.each do |k, v| v.sort! do |a| - (a - p2s).dist + (a - p2s).sum end end