Skip to content

Instantly share code, notes, and snippets.

@albertbellonch
Last active August 29, 2015 14:05
Show Gist options
  • Save albertbellonch/11dc19520217a080a506 to your computer and use it in GitHub Desktop.
Save albertbellonch/11dc19520217a080a506 to your computer and use it in GitHub Desktop.
Pot draw
#!/usr/bin/env ruby
# Assuming pot_a, pot_b, pot_c and pot_d are 4 arrays with 8 players each.
pots = [pot_a, pot_b, pot_c, pot_d]
%w{ A B C D E F G H }.each do |group_id|
players = pots.map do |pot|
pot.shuffle!
pot.pop
end
puts "[Group #{group_id}] #{players.join(', ')}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment