aoc2025/day_07/point.rb
2025-12-08 03:16:37 +00:00

25 lines
259 B
Ruby

class Point
attr_reader :x, :y
def initialize(x, y)
@x = x
@y = y
end
def to_s
"(#{x}, #{y})"
end
def ==(other)
x == other.x && y == other.y
end
def hash
[x, y].hash
end
def eql?(other)
self == other
end
end