Assignment 9 – Santorini: a tournament administrator
1 Build and test

Assignment 9 – Santorini: a tournament administrator

.

Due Sunday 12/02 11:59pm

1 Build and test

Implement an administrator for a Santorini tournament. The administrator should wait for a number of connections from remote players and when all have established their connections, it should administer either a round-robin or a single-elimination tournament between them. If the number of remote players is not a power of two then enough default local players should be added to the tournament to reach the closest power of two.

After a tournament is complete the administrator should write the final ranking of the players to STDOUT. For a single-elimination tournament, players that have been eliminated in the same round share the same rank.

If during a game of the tournament, the referee of the game observes that a player is cheating, then the player should be eliminated from the tournament and placed at the bottom of the ranking. For a round-robin tournament, all of the points the cheating player won until its elimination should be granted to the opponents it defeated. For the rest of the tournament, the cheating player should be replaced by a default player.

The administrator should retrieve its IP and port, and the relative path of the implementation of the default player from a configuration file “santorini.config” that contains a JSON object of the form: {"IP" : s, "port" : n, "default-player" : s} where n is a number and s strings. The administrator should load dynamically the default player using the path provided in the configuration file.

The administrator should retrieve the number of remote players it should expect and the style of the tournament from the command line. In particular launching the administrator with a single –league n command line argument should run a round-robin tournament with n players and similarly for –cup n and a single-elimination tournament. These arguments are mutually exclusive.

To achieve the above you may have to adjust the interface of your referee component from assignment 6. That said, you should not modify the communication protocol for player components from assignment 8.

Run enough tournaments to gain some confidence that your implementation works correctly. As for assignment 8, use random testing to do so. In this case, a random player should occasionally select plays that break the rules of the game.

Deliverables: In your team’s GitHub repository, create a directory "Deliverables/9/9.1/" and deposit there an executable or script for the tournament administrator called “santorini” and the corresponding configuration file.