blockmap.rb
# Try to calculate what the best colour to change to would be, based on
# the number of blocks collected by changing to that colour.
Try to calculate what the best colour to change to would be, based on
the number of blocks collected by changing to that colour.
Try to calculate what the best colour to change to would be based on the number of blocks collected by changing to that colour .
def best_colour
      build_block_list
      edges = []
      @tl_list.each do |col, row|
        neighbours(col, row).each do |c, r|
          col = @blocks[r][c]
          edges << [col, c, r] if col != @tlc && !edges.include?([col, c, r])
        end
      end
      max_colour_count(edges)
    end
def best_colour build_block_list edges = [ ] @tl_list . each do | col , row | neighbours ( col , row ) . each do | c , r | col = @blocks [ r ] [ c ] edges << [ col , c , r ] if col != @tlc && ! edges . include? ( [ col , c , r ] ) end end max_colour_count ( edges ) end
Try to calculate what the best colour to change to would be, based on
the number of blocks collected by changing to that colour.
Try to calculate what the best colour to change to would be based on the number of blocks collected by changing to that colour .