Yahtzeeql – Yahtzee solver that's mostly SQL

https://news.ycombinator.com/rss Hits: 6
Summary

Yahtzeeql - Yahtzee solver that's mostly SQL Setup python3 -m venv yahtzee-venv source yahtzee-venv/bin/activate pip install -r requirements.txt ./test.sh You should see outputs for each strategy, in ascending order by goodness Usage python3 yahtzee.py --strategy <strategy> --runs <runs> [--interactive] [--show-plot] Where strategy is one of: random - just keep the dice you're given, and pick a random category - just keep the dice you're given, and pick a random category random_greedy - just keep the dice you're given, and pick the category that gives the highest score - just keep the dice you're given, and pick the category that gives the highest score all_yahtzee - Do everything possible to get a Yahtzee every turn - Do everything possible to get a Yahtzee every turn prob - Use probability tables to maximize the fraction of points you earn - Use probability tables to maximize the fraction of points you earn prob_with_difficulty - Use probability tables to maximize the fraction of points you earn, considering the difficulty of each category --runs is the number of games to simulate --interactive will show you the dice and ask you to pick a category for each turn --show-plot will show you a plot of the score distribution Probabilty tables build_prob_db.py generates a sqlite database with a few tables: all_rolls - All rolls of 5 dice, with dice sorted in ascending order - All rolls of 5 dice, with dice sorted in ascending order roll_transitions - The probability of transitioning from one roll to another, while keeping some subset of the first roll - The probability of transitioning from one roll to another, while keeping some subset of the first roll level0 - For each roll, its score in each category, reprersented as a fraction of the maximum possible score in that category, and the raw score - For each roll, its score in each category, reprersented as a fraction of the maximum possible score in that category, and the raw score level1 - For each roll, the expected va...

First seen: 2025-05-18 21:52

Last seen: 2025-05-19 02:53