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
class Table

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

end
--- 
+++ 
@@ -1,8 +1,12 @@
 class Table
 
   def initialize(width,height)
-    @width = width
-    @height = 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
