class Table

  def initialize(width,height)
    @width = width
    @height = height
  end

end
class Table

  def initialize(width,height)
    @width = 0..width
    @height = 0..height
  end

  def valid_position?(x,y)
    @width.include?(x) and @height.include?(y)
  end

end
Check for valid range in Table Class
Check for valid range in Table Class
