Skip to content

Instantly share code, notes, and snippets.

@jsuchal
Last active August 29, 2015 14:22
Show Gist options
  • Save jsuchal/f3d7ce0ba767643d965e to your computer and use it in GitHub Desktop.
Save jsuchal/f3d7ce0ba767643d965e to your computer and use it in GitHub Desktop.
participants = {
'@ppidanic' => {shares: 0, likes: 0, statuses: 1},
'@honzajavorek' => {shares: 2, likes: 2, statuses: 2},
'@tylersiprova' => {shares: 7, likes: 10, statuses: 5},
'@jakub_lesko' => {shares: 0, likes: 0, statuses: 1},
'@ondrek' => {shares: 0, likes: 0, statuses: 1},
'@Puigcerber' => {shares: 4, likes: 7, statuses: 5},
'@OndroNR' => {shares: 0, likes: 0, statuses: 1},
'@martin_strycek' => {shares: 0, likes: 0, statuses: 2},
'@PredragToptal' => {shares: 0, likes: 0, statuses: 2},
'@tommaj' => {shares: 0, likes: 2, statuses: 2},
'@lulco' => {shares: 2, likes: 3, statuses: 1},
'@HonzaKral' => {shares: 1, likes: 4, statuses: 1},
'@andrejkrivulcik' => {shares: 0, likes: 2, statuses: 3},
'@JozefSzadvari' => {shares: 1, likes: 3, statuses: 3},
'@BranoLukac' => {shares: 0, likes: 1, statuses: 1},
'@adamliesko' => {shares: 0, likes: 1, statuses: 1},
'@markoph' => {shares: 2, likes: 1, statuses: 1},
'@PeterKolesar' => {shares: 0, likes: 0, statuses: 1},
'Jan Toth' => {shares: 0, likes: 2, statuses: 1},
}
roulette = []
participants.each do |participant, stats|
stats[:shares].times do
roulette += [participant] * 20
end
stats[:likes].times do
roulette << participant
end
stats[:statuses].times do
roulette << participant
end
end
winners = {}
Random.srand(20150618)
begin
winners[roulette.sample] = true
end while winners.size < 10
puts winners.keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment