Assignment 9 – GO: the tournament
1 Design, Build and Test

Assignment 9 – GO: the tournament

.

Due Tuesday 11/26 11:59pm

1 Design, Build and Test

Implement an administrator for a GO tournament (9x9 board size). 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 a game finishes in a draw, the tournament administrator decides the winner with an unbiased coin flip. Morever, if during a game, the referee observes that a player is cheating, then the tournament administrator should eliminate the cheating player from the tournament and place it 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 tournament administrator should retrieve its IP and port, and the relative path of the implementation of the default player from a configuration file "go.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 tournament administrator should load dynamically the default player using the path provided in the configuration file.

The tournament 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 tournament 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 or other components you designed in previous asssignments. As before, note any changes you make to existing parts of ypur code base so that we can discuss them during code walks.

That said, you should not modify the communication protocol for player components from assignment 7 except by adding the following. When a game finishes your referee should notify both players in a game that the game is over. For remote players this boils down to receiving a message ["end-game"] to which it replies with the JSON string "OK".

Similar to assingment assignment 8, the easiest effective way to test the complete tournament version of your GO implementation is random testing.

Deliverables: In your team’s GitHub dev repository, create a directory "Deliverables/9/9.1/" and deposit there a Makefile for the tournament administrator with a specific default player. We will use it to run a number of tounraments both in cup and league mode with our own remote players. You can assume out players will send valid JSON to the admin but you should not make any further assumptions about the shape or order of these messages.