6 — The Ref & the Players
Due Thursday, 24 October 2019, midnight
Delivery Place the product of this week’s project steps into your repo as follows:
for the Design Task, place tournament-observers.md and game-observers.md in Planning/
- for the Programming Task, place
player-interface.PP in Common/
player.PP in a new Player/ directory within Tsuro
first-s.PP in Player/
referee.PP in a new Admin/ directory in Tsuro
for the Testing Task, place xrules and rules-tests in a directory named 6
Design Task 5 —
Design the interfaces of tournament-level and game-level observers.
Describe which existing interfaces you must modify, and how, to accommodate these observers.
Two pages should suffice. Less is more.
Programming Task Co-design implementations for the following components:
a player component that performs the mechanical tasks of initial moves and taking turns;
The player does not check for the legality of its strategy’s decisions.
a strategy component, dubbed first-s, that performs the intelligent tasks for the player;
Specifically the strategy must perform two tasks as follows:When the player is asked to place an initial tile, it searches for the first legal spot available in clockwise direction starting from (0,0) [exclusive]. To place the avatar, the player searches for the first legal port again in clockwise fashion that faces an empty square. The player uses the third given tile, without rotating it.
When the player is asked to take its turn, it uses the first given tile without rotating it. It does not check the legality of this action.
We will use this deterministic strategy for integration testing.We may implement alternative strategies later in the semester.
a referee component, which can run a complete Tsuro game for an list of players, arranged in decreasing order according to "age"
The referee assigns each player in the list a color from the color sequence in the specified order. For the game, the component uses the tiles in numerical order, cycling through this list as needed.
We will use this deterministic strategy for integration testing.
The implementation of the referee component demands the identification of possibly abnormal conditions. A player that cheats gets definitely eliminated. Identify any other abnormal condition that your referee takes care of in the purpose statement for the component; also list those that you intend to leave for the distributed phase.
When a player requests the placement of a tile during its turn, the requested placement must not conflict with the given information and the rule checker must bless the tile placement as legal.
the player’s exit from the board and if the player is forced to commit suicide because all new edges force it out, the player gets removed as if it had exited the board through the action of some other player and the chosen tile gets placed.
any avatar to go into an infinite loop and if the player is forced to construct such a loop, then the referee deals with this situation exactly like a suicide through board exit, except that no tile gets placed.
Describe the complete player interface in a file called a player-interface.PP. Use a proper combination of your programming language and English.
Testing Task Develop a test harness for the rule checker’s capability of evaluating the legality of a turn.
An input is the same as in 5 —
The outputs are "legal" and "cheating"; each action demands one output.
Create five tests and place them in rules-tests.