Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

The Rules

  1. 32 teams split into 4 teirs (by their FIFA ranking)
  2. 8 entries
  3. Each entry is randomly assigned 1 team per tier
require 'yaml'
@teams = YAML::load(File.open('teams.yaml'))
@players = %w[Player1 Player2 Player3 Player4 Player5 Player6 Player7 Player8]
results = Hash.new
players = @players.sort_by{rand}
players.each_with_index do |p, i|
results[p] = Array[@teams['teir_one'][i]]
end
second = @players.sort_by{rand}
second.each_with_index do |p, i|
results[p] << @teams['teir_two'][i]
end
third = @players.sort_by{rand}
third.each_with_index do |p, i|
results[p] << @teams['teir_three'][i]
end
fourth = @players.sort_by{rand}
fourth.each_with_index do |p, i|
results[p] << @teams['teir_four'][i]
end
p results
teir_one:
- Brazil
- Spain
- England
- Netherlands
- Argentina
- Germany
- Chile
- Portugal
teir_two:
- Uruguay
- Serbia
- Italy
- France
- Ivory Coast
- United States
- Mexico
- Paraguay
teir_three:
- Denmark
- Cameroon
- Australia
- South Korea
- Honduras
- Slovenia
- Nigeria
- Switzerland
teir_four:
- Ghana
- Greece
- Japan
- Slovakia
- South Africa
- Algeria
- North Korea
- New Zealand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.