ruby_light_map_creator.rb
  Speckle sort is an algorithm that attempts to "sort" the color chart by randomness weight.
  Step by Step:
   - First, SS populates the entire color_chart with the dominate color.
   - Then, SS asks for the weight of each palette color.
   - After, using the newly acquired weights, SS will generate a lightmap from the given code.
Speckle sort is an algorithm that attempts to "sort" the color chart by randomness weight.
Step by Step:
First, SS populates the entire color_chart with the dominate color.
Then, SS asks for the weight of each palette color.
After, using the newly acquired weights, SS will generate a lightmap from the given code.
Speckle sort is an algorithm that attempts to " sort " the color chart by randomness weight . Step by Step : First SS populates the entire color_chart with the dominate color . Then SS asks for the weight of each palette color . After using the newly acquired weights SS will generate a lightmap from the given code .
def speckle_sort(lightmap_formula, max_x, max_y, color_chart, palette)
    populate_chart_with_color(max_x, max_y, color_chart, lightmap_formula[3])
    @weight_classes = []
    palette.each_with_index { |param, index|
      input = nil
      until input.is_a?(Fixnum) do
        print "Please enter a random weight for color #{param.hex}: "
        begin
          input = Integer(gets)
          @weight_classes[index] = [input, param.hex]
          puts "Added weight (#{input}) for #{param.hex} successfully!"
        rescue ArgumentError
          puts 'That wasn\'t a number. Please enter a number.'
          input = nil
        end
      end
    }
    puts "Done. Finalized size: #{@weight_classes.length}"
    @weight_classes.sort
    for y in 1..max_y
      row = Array.new(max_x)
      for x in 0..max_x
      end
      color_chart[y] = row
    end
    100.times do
      out = pick(@weight_classes)
      puts "Iteration: #{out}"
    end
  end
def speckle_sort ( lightmap_formula , max_x , max_y , color_chart , palette ) populate_chart_with_color ( max_x , max_y , color_chart , lightmap_formula [ 3 ] ) @weight_classes = [ ] palette . each_with_index { | param , index | input = nil until input . is_a? ( Fixnum ) do print "Please enter a random weight for color #{param.hex}: " begin input = Integer ( gets ) @weight_classes [ index ] = [ input , param . hex ] puts "Added weight (#{input}) for #{param.hex} successfully!" rescue ArgumentError puts 'That wasn\'t a number. Please enter a number.' input = nil end end } puts "Done. Finalized size: #{@weight_classes.length}" @weight_classes . sort for y in 1 .. max_y row = Array . new ( max_x ) for x in 0 .. max_x end color_chart [ y ] = row end 100 . times do out = pick ( @weight_classes ) puts "Iteration: #{out}" end end
Speckle sort is an algorithm that attempts to "sort" the color chart by randomness weight.
Speckle sort is an algorithm that attempts to " sort " the color chart by randomness weight .
lightmap_formula
<not_specific>
max_x
<not_specific>
max_y
<not_specific>
color_chart
<not_specific>
palette
<not_specific>