class Arena

Public Class Methods

new(width: 5, height: 5) click to toggle source
# File lib/another_toy_robot/arena.rb, line 2
def initialize(width: 5, height: 5)
  @columns = 0...width
  @rows    = 0...height
end

Public Instance Methods

inbounds?(position) click to toggle source
# File lib/another_toy_robot/arena.rb, line 7
def inbounds?(position)
  @columns.cover?(position.x_coord) && @rows.cover?(position.y_coord)
end