Write a program to do the following:
- Query the user for the number of teams to play in a
single-elimination tournament. Ensure this number is a power
of two.
- Ask for a name for each of the teams and ensure that each name
is unique.
- List all the games to be played, and give each game a unique
identifying number.
- Allow the user to identify the game being played and the result.
Once all results are in, continue by printing the next set of games
to be played.
Continue until the required games of a single-elimination tournament
are satisfied and then calculate a winner.
You can read about a single-elimination tournament at
Wikipedia.
Modifications
Schedule an optional game to decide who comes in third by having those teams that lost the semi-finals play against each other.
Store information in a text file so that the information is preserved
even if the program is terminated. Then, when the program is started
again, allow a command-line argument to be the file containing information
to be read in.
Write a function to graphically display the games played so far.