Sha256: 0a0e08254b75fd6f481d2fac297019850440ceb7024d53bad92d658301c2971b

Contents?: true

Size: 215 Bytes

Versions: 2

Compression:

Stored size: 215 Bytes

Contents

module Model
  Location = Struct.new(:x, :y) do
    def to_s
      "(#{x}, #{y})"
    end

    def <=>(other)
      if x == other.x
        y <=> other.y
      else
        x <=> other.x
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
karel-interpreter-0.2.0 lib/karel/model/location.rb
karel-interpreter-0.1.0 lib/karel/model/location.rb