World Cup Draw script

The 2014 World Cup draw is on Friday. ESPN.com has a draw simulator. I thought it would be cool to make one of my own!

This took me about an hour to do. I’m sure there’s an easier way to do this, but I’m working with what I know.

Breakdown
The World Cup features 32 teams organized into 8 groups of 4. The teams are separated into 4 pots (32/8 = 4) The top 8 teams in the FIFA world rankings are assigned to different groups so that they don’t play each other until the 2nd round. The top 8 teams are assigned to POT 1.

The teams assigned to POTS 2, 3, 4 are based on geographical region. The African and South American teams are in POT 2. The North American and Asian teams are in POT 3. The European teams are in POT 4.

FIFA will select one team from each pot (1, 2, 3, 4) and these 4 teams will be Group A. The process will continue until there are no more teams remaining.

**But there’s a twist this year. Pot 2 has 7 teams and Pot 4 has 9 teams. FIFA wanted to avoid too many Euro teams in one group. My code doesn’t use their methodology exactly. I took the last team from Pot 4 and assigned it to Group B.

I then eyeballed the values in the array and did a puts to print the result. Code is below. Some sample group pairings are also included.

RANDOM RESULT #1

Group A
——-
Brazil
Ghana
USA
Netherlands

Group B
——-
Colombia
Algeria
Japan
France

Group C
——-
Belgium
Ecuador
Honduras
Italy

Group D
——-
Spain
Chile
Australia
Russia

Group E
——-
Germany
Nigeria
Korea Republic
Bosnia-Herzeg.

Group F
——-
Uruguay
Cote d’ Ivoire
Iran
Croatia

Group G
——-
Switzerland
Cameroon
Mexico
Portugal

Group H
——-
Argentina
Greece
Costa Rica
England

RANDOM RESULT#2

Group A
——-
Brazil
Algeria
Mexico
Bosnia-Herzeg.

Group B
——-
Uruguay
Ghana
Iran
Italy

Group C
——-
Argentina
Ecuador
Japan
Greece

Group D
——-
Belgium
Chile
Australia
Croatia

Group E
——-
Switzerland
Nigeria
Costa Rica
England

Group F
——-
Germany
Cote d’ Ivoire
Honduras
Russia

Group G
——-
Colombia
Cameroon
Korea Republic
Portugal

Group H
——-
Spain
France
USA
Netherlands

RANDOM RESULT #3

Group A
——-
Brazil
Cameroon
Korea Republic
England

Group B
——-
Belgium
Chile
USA
Russia

Group C
——-
Spain
Cote d’ Ivoire
Honduras
Italy

Group D
——-
Argentina
Ghana
Iran
Bosnia-Herzeg.

Group E
——-
Switzerland
Nigeria
Costa Rica
Croatia

Group F
——-
Uruguay
Ecuador
Japan
France

Group G
——-
Colombia
Algeria
Mexico
Netherlands

Group H
——-
Germany
Greece
Australia
Portugal

Leave a Reply