Skip to content

Instantly share code, notes, and snippets.

@jdwyah
Created August 31, 2013 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdwyah/6395458 to your computer and use it in GitHub Desktop.
Save jdwyah/6395458 to your computer and use it in GitHub Desktop.
names.each_with_index do |name, i|
z = zipped[i].sort
avg = z.inject{ |sum, el| sum + el }.to_f / z.size
index = (MONTE * 0.95).to_i
if(HUMAN)
puts "Avg servings #{avg} 95th pct #{z[index]} max #{z[-1]} #{name}"
else
puts "\"#{name}\", #{avg}, #{z[index]}, #{z[-1]}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment