greeness / yahtzee-optimal-strategy

MIT License
5 stars 3 forks source link

Intro:

This repo implements the dynamic programming algorithm described in James Glenn's May 2006 paper "An Optimal Strategy for Yahtzee". The strategy is the version without Yahtzee bonus and written in python.

An online version of the same strategy can be found here (developed by Tom Verhoeff, Erik Scheffers) http://www-set.win.tue.nl/~wstomv/misc/yahtzee/yptd.php

Files:

combinatorics_class.py: combinatorics utilities scoring.py: roll and yahtzee categories utilties unreachable.py: dp to remove unreachable states described in the paper section 4.3. widget.py: the core unit to calculate optimal strategies for each state (section 4.1-4.2)

sim_game.py: online calculating inside-state strategy sim_game_with_cache.py: use pre-calculated top 2 strategy