This contest is completely optional!
Due by 11:59pm on Thursday, 10/3.
Instructions. Submit a hog.py file containing a function called final_strategy, using the command:
submit proj1contest
Overview. Each submitted strategy will play against all other submissions. We will exactly compute the expected win rate for each player, so that the outcome of this tournament will be determined by strategy alone and not the roll of the dice. A submission scores a match point each time it has an expected win rate above 50%. The submissions with the most match points win.
Contest Rules:
In addition to the special rules described in the Hog Project, there is one additional special rule:
Ham Hijinks. A player may choose to roll -1 dice; she scores 1 point for the turn and exchanges the dice. If the total number of times any player has exchanged the dice during the game is odd, then four-sided dice are rolled when six-sided dice would normally be rolled, and vis versa. That is, players will roll four-sided dice unless Hog Wild is in effect, in which case they will roll six-sided dice.
An example game: Player 0 rolls -1, exchanging the dice: the score is 1 to 0. Next, Player 1 rolls 2 dice; she rolls four-sided dice due to the previous exchange, and earns (let's say) six points: the score is 1 to 6. Player 0 rolls 4 six-sided dice (because of Hog Wild), earning (let's say) 13 points: the score is 14 to 6. Player 1 rolls -1, exchanging the dice again and invoking Swine Swap: the score is 7 to 14. Player 0 would next roll four-sided dice because of Hog Wild.
Note: Players do not know how many dice the opponent chose to roll and thus cannot be certain how many times the dice have been exchanged. The values bound to the global names four_sided and six_sided will not indicate what dice are being used.
The contest may be entered individually or in pairs. Two people submit a single entry. Each person in the course can only be associated with at most one entry.
All strategies must be deterministic, pure functions of the current player scores! Non-deterministic strategies or strategies based on the history of the game will be disqualified.
Calling your final_strategy function on every possible pair of scores should take less than 5 minutes. Less than 5 seconds is strongly preferred.
Winning entries will receive 2 points of extra credit.
Winners will also be recognized publicly in future iterations of 61A.