Day10: tuples are iterable.

This commit is contained in:
Danila Fedorin 2020-12-07 17:06:30 -08:00
parent 8a7eab81e0
commit f052d8ef78
1 changed files with 1 additions and 5 deletions

View File

@ -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