Class: Amaze::Grid::Delta
- Inherits:
-
Amaze::Grid
- Object
- Amaze::Grid
- Amaze::Grid::Delta
- Defined in:
- lib/amaze/grid/delta.rb
Instance Attribute Summary
Attributes inherited from Amaze::Grid
Instance Method Summary collapse
Methods inherited from Amaze::Grid
#[], #deadends, #each_cell, #each_row, #initialize, #random_cell, #size
Constructor Details
This class inherits a constructor from Amaze::Grid
Instance Method Details
#configure_cell ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/amaze/grid/delta.rb', line 13 def configure_cell each_cell do |cell| row, column = cell.row, cell.column cell.east = self[row, column+1] cell.west = self[row, column-1] if (row+column).even? cell.north = self[row-1, column] else cell.south = self[row+1, column] end end end |