A function that makes
Ten thousand choices is a Final strategy.
This contest is completely optional!
Submit a hog.py
file containing a function called final_strategy
and a name
called final_bid
bound to a non-negative integer, using the command:
submit proj1contest
A blank hog.py
file and simple tests for correct formatting can be downloaded
as a zip archive. Type python3 ok
to run the provided tests.
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. The final_bid
of each player will be used to determine who
plays first and the starting scores of each player.
A submission scores a match point each time it has an expected win rate above
50%. The submissions with the most match points win. Ties are broken by the win
rate against an always_roll(5)
agent that plays first with a starting score
of 0 to 0.
Tree recursion may be helpful. An example use is described in this video.
final_strategy
function on every possible pair of scores
should take less than 5 minutes. Less than 5 seconds is strongly preferred.