blockmap.rb
# Return a list of the in-grid neighbours of the passed position
Return a list of the in-grid neighbours of the passed position
Return a list of the in - grid neighbours of the passed position
def neighbours(col, row)
      neigh = []
      [-1, +1].each do |inc|
        new_col = col + inc
        new_row = row + inc
        neigh << [new_col, row] if in_grid?(new_col, row)
        neigh << [col, new_row] if in_grid?(col, new_row)
      end
      neigh
    end
def neighbours ( col , row ) neigh = [ ] [ - 1 , + 1 ] . each do | inc | new_col = col + inc new_row = row + inc neigh << [ new_col , row ] if in_grid? ( new_col , row ) neigh << [ col , new_row ] if in_grid? ( col , new_row ) end neigh end
Return a list of the in-grid neighbours of the passed position
Return a list of the in - grid neighbours of the passed position
col
<not_specific>
row
<not_specific>