Fargo is a dice game, with scoring as follows:
- Three of a kind
nis worth100npoints, except three 1's count as1000points. - Any 5 rolled is worth
50points. - Any 1 rolled is worth
100points.
A player begins her turn by rolling 10 dice. Any dice which score points (i.e. 3 of a kind, 1, or 5) are scored and removed, and the player then decides to either 1) keep her points and end her turn; or 2) roll the remaining dice to score more points. After the second roll, points are scored and the player again chooses to keep her points or continue rolling the remaining dice, etcd... If a roll results in 0 points added to the score, then the turn is over and the turn is worth 0 points. In the event that all 10 dice are used, the points are banked and a second set of 10 dice is rolled, etc. Players take turns until one player reaches a score over 10 000 points, at which point everyone else takes one more turn and the player with the highest score wins.
-
nDiceResult.pycalculates the results for rolling N = 1-10 dice, then converts those results to a dictionary for each N . The results fromnDiceResult.pyare stored inprobDicts.pyfor repeated use. -
probDicts.pystores a list of result dictionaries, one for each N = 1-10 dice rolled. Each dictionary's keys are the distinct scoring results as (points_scored:dice_left), and the dictionary's values are the probability of the key's outcome. This data is created bynDiceResult.pyand used inEV.py. -
EV.pyfinds the expected value of a Fargo turn given a strategy vector. -
EVEvolution.pyIncludes the main evolution functions, which are combined withEV.pyandprobDicts.pyto perform a genetic algorithm. Some results are included at the end. -
EVEvolution_step.pyis a copy ofEVEvolution.pythat includes step optimization at the end of each generation. (The strongest strategies converged much more frequently with this step optimization.) -
trialdata.jsonincludes the results of 100 trials of 1000 strategy vectors with step optimization. It is imported analyzed near the end ofEVEvolution_step.py. This trial data was created Fall 2016 over the course of 48 hours on a laptop with ~8 GB memory. The data fromtrialdata.jsonare stored as 100 separate files in thetrial1datadirectory.
-
fargo.pyinitializes the game, with theturn()function -
strat.pyexplores some pure strategies for Fargo, involving minimum number of dice, and a minimum score cutoff. -
firstfargo.pyis a first attempt at writing the fargo function in Python. It also includes some probabilities -
maxminscores.odsis a spreadsheet containing some basic calculations about maximum and minimum possible scores for N = 1-8 dice remaining, as well as some information about number of distinct scoring outcomes resulting from N = 1-8,10 dice.