module NasaRovers class Coord def self.origin @origin ||= new(0, 0) end def self.factory(data) new(*data.split(" ")) end attr_accessor :x, :y def initialize(x, y) @x, @y = x.to_i, y.to_i end def to_s "#{x} #{y}" end def >=(other) x >= other.x && y >= other.y end def <=(other) x <= other.x && y <= other.y end def ==(other) x == other.x && y == other.y end end end