March is an exciting time for college basketball fans. Each year the best teams compete against each in a single elimination tournament to find out who is the best of the best and will be come the National Champion. The first round starts with 64 teams that are paired up and play each other. The teams are divided into four regions (East, West, Midwest, South) and given ranks within these regions.
The highest ranked team plays the lowest ranked team, the second highest plays the second lowest, and so forth for each region. The next round pits the winner of the first and last ranked teams against the winner of the two middle teams and the winner of the second and second to last against the next level out from the middle. This continues until only one team from each region remains. Then the winners of the East and West compete as well as the winners of the Midwest and South. Finally two teams compete in the National Championship game.
For this challenge we’ve been tasked with creating interactive ways for fans to enjoy tracking and predicting which teams will win. It has become a tradition among many fans to create “brackets” where they predict who will win each game and then compare these with their friends.
While not everyone is a sports fan this challenge involves the usage and manipulation of objects, arrays, and several other data types along with creating interactive user interfaces.
No matter the level you choose to work with write a test case before you start your code. Then write just enough code to pass the test. Once you have passing code refactor to pass other test cases.
Below is a list of ranking from the first round of last year’s NCAA tournament. For each region (East, West, Midwest, South) pair up the teams that will play each other and display them as a pair. For example in the East region Vilanova will play Mt. St. Mary’s in the first round.
|1. Vilanova||1. Gonzaga||1. Kansas||1. N. Carolina|
|2. Duke||2. Arizona||2. Louisville||2. Kentucky|
|3. Baylor||3. Florida St.||3. Oregon||3. UCLA|
|4. Florida||4. W. Virginia||4. Purdue||4. Butler|
|5. Virginia||5. Notre Dame||5. Iowa St.||5. Minnesota|
|6. SMU||6. Maryland||6. Creighton||6. Cincinnati|
|7. S. Carolina||7. St. Mary’s||7. Michigan||7. Dayton|
|8. Wisconsin||8. Northwestern||8. Miami||8. Arkansas|
|9. Va. Tech||9. Vanderbilt||9. Michigan St.||9. Seton Hall|
|10. Marquette||10. VCU||10. Oklahoma St.||10. Wichita St.|
|11. USC||11. Xavier||11. Rhode Island||11. Kansas St.|
|12. UNC-Wilm.||12. Princeton||12. Nevada||12. Middle Tenn.|
|13. ETSU||13. Bucknell||13. Vermont||13. Winthrop|
|14. New Mex St.||14. FGCU||14. Iona||14. Kent St.|
|15. Troy||15. North Dakota||15. Jax. State||15. N. Kentucky|
|16. Mt. St. Mary’s||16. S. Dak. St.||16. UC Davis||16. Texas So.|
Going a step further build a view that displays the teams playing each other in a similar fashion to the brackets in the link below.
Starting with the paired list of round one competitions build functionality to allow users to predict who will win each game. Once the predicted winners of two with the order list of paired teams and allow users to predict who will win each game.
Going a step further allow predictions beyond the current round so that users can make predictions based on their predicted winners.
Since users are allowed to predict the outcome of games they will want to know if they are correct. Assuming you will be pulling this data from a reliable source mock that with a set of winners and have your bracket periodically check it to update the with the winners of each round. Create a visual way of displaying that a team has won or lost and remove losing teams from future predictions requiring the user to create new predictions based on “actual” outcomes.
Add in scores from the games that have been played so that users can see the scores for each team once the have finished a game. Going even further add in scores of games being played currently with a way of identifying them as in progress vs final scores.