- 32 teams split into 4 teirs (by their FIFA ranking)
- 8 entries
- Each entry is randomly assigned 1 team per tier
-
-
Save kylemac/91e1f1c392bed8074531 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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