mirror of
https://github.com/onyx-and-iris/aoc2025.git
synced 2025-12-08 19:57:48 +00:00
25 lines
259 B
Ruby
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
|