lib/number-placement.rb
def placeable(v, board)
      unless @floating[v]
        return []
      end
      r = @cells
      @cells.each do |x, y|
        board.neighbors(x, y).each do |n|
          next if self === n
          unless n.floating[v]
            r -= n.cells
          end
        end
      end
      return r
    end
# Array of cells where valuve v can be placed
Array of cells where valuve v can be placed
Array of cells where valuve v can be placed
def placeable(v, board)
      unless @floating[v]
        return []
      end
      r = @cells
      @cells.each do |x, y|
        board.neighbors(x, y).each do |n|
          next if self === n
          unless n.floating[v]
            r -= n.cells
          end
        end
      end
      return r
    end
def placeable ( v , board ) unless @floating [ v ] return [ ] end r = @cells @cells . each do | x , y | board . neighbors ( x , y ) . each do | n | next if self === n unless n . floating [ v ] r -= n . cells end end end return r end
Array of cells where valuve v can be placed
Array of cells where valuve v can be placed
v
board