Skip to content

Instantly share code, notes, and snippets.

@Tristramg
Created June 11, 2011 16:56
Show Gist options
  • Save Tristramg/1020746 to your computer and use it in GitHub Desktop.
Save Tristramg/1020746 to your computer and use it in GitHub Desktop.
max = 99
nb = 64
str = ""
sum = 0
(nb-1).times do
i = (rand * max).floor
sum += i
str += i.to_s + " "
end
to_reach = (sum.to_f/(nb-1)).ceil * nb
str += (to_reach - sum).to_s
puts str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment