Sha256: 9f5f77eb27c4cce161742a521314b2af23d11a5cf9d17814198ba9fedc62da6d

Contents?: true

Size: 285 Bytes

Versions: 2

Compression:

Stored size: 285 Bytes

Contents

class Table

  def initialize(dimension = 5)
    @dimension = dimension 
  end

  def forbid_move?(x, y)
    coordinate_out_of_range?(x) || coordinate_out_of_range?(y)
  end

private

  def coordinate_out_of_range?(coordinate)
    not (0..@dimension-1).include? coordinate
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
r3d3-0.1.1 lib/r3d3/models/table.rb
r3d3-0.1.0 lib/r3d3/models/table.rb