# Optimal Solitaire Yahtzee Player: Rules

## Introduction

The Optimal Solitaire Yahtzee Player plays according to the Official Yahtzee Rules. These are, for instance, the rules implemented in the Electronic Hand-Held Yahtzee Game. The following sections explain my interpretation of these rules.

## General Rules

A game of Yahtzee requires five dice and a score card. On the score card is a list of thirteen dice patterns. Next to each pattern is a box in which to enter a score. Initially all boxes are empty. A game of Yahtzee consists of as many turns as there are patterns on the score card.

Each turn consists of an assembly phase followed by a scoring phase. The assembly phase is started by rolling all dice. Next come two modification attempts. In each modification attempt, the player chooses a subset of the dice (the keepers) and re-rolls the other dice. In the scoring phase, the player chooses a pattern on the score card with an empty box, and enters a score in it. The score is determined by the pattern scoring rules based on the final roll of the assembly phase, and the chosen pattern.

When all boxes have been filled with scores, the game ends. The final score is determined by the final scoring rules, based on the final state of the score card. The aim of Solitaire Yahtzee is to maximize the final score.

## Notes

1. In a modification attempt, you may choose any set of keepers, ranging from all dice to none. Keeping all dice boils down to skipping the modification attempt.
2. The two modification attempts are independent. That is, there is no restriction on the second set of keepers, e.g. it need not be a superset of the first set.
3. You may choose any dice pattern for scoring, as long as its box is empty. The resulting score can however be zero.
4. After scoring a dice pattern, its box is nonempty, possibly containing a zero score.

## Pattern Scoring Rules

Upper Section
PatternConditionScore
Acesnonetotal value of all aces (ones)
Twosnonetotal value of all twos
Threesnonetotal value of all threes
Foursnonetotal value of all fours
Fivesnonetotal value of all fives
Sixesnon total value of all sixes
Lower Section
PatternConditionScore
Three of a kind3 or more equalstotal value of all dice
Four of a kind4 or more equalstotal value of all dice
Full House3 equals + 2 other equals25
Small Straightsequence of 4 or more30
Large Straightsequence of 540
Yahtzee5 equals50
Chancenonetotal value of all dice

The indicated pattern score is obtained only if the condition is met; otherwise, the score is zero, unless the extra Yahtzee rules apply. Here is a brief further explanation of the pattern conditions when scoring a dice roll in the Lower Section:

Three of a kind
At least three dice show the same value: a, a, a, b, c.
Four of a kind
At least four dice show the same value: a, a, a, a, b.
Full House
Three dice show one value and two another value: a, a, a, b, b with a<>b.
Small Straight
At least four dice values are in sequence: a, a+1, a+2, a+3, b.
Large Straight
All dice values are in sequence: a, a+1, a+2, a+3, a+4.
Yahtzee
All dice values are the same: a, a, a, a, a.

## Extra Yahtzee Rules

Extra Yahtzee rolls (of 5 equals) are treated specially in the pattern scoring rules:
Extra Yahtzee Bonus
Each Yahtzee roll (of 5 equals) earns a bonus of 100 (the Extra Yahtzee Bonus), no matter for what pattern it is scored, provided that the Yahtzee pattern has already been scored with 50. Note however that this bonus does not count toward reaching the threshold for the Upper Section Bonus.
Extra Yahtzee as Joker in Lower Section
A Yahtzee roll (of 5 equals), say of value v, can be scored in full for the patterns Full House (25), Small Straight (30), or Large Straight (40), provided that both the Yahtzee pattern and the v-pattern in the Upper Section have already been scored (zeroes are OK). In that case, the Yahtzee roll is said to act as a Joker.

## Final Scoring Rules

The final score is the total of all pattern scores, plus 35 (the Upper Section Bonus) if the total of the Upper Section scores, each taken modulo the Extra Yahtzee Bonus (i.e. 100), is at least 63 (the threshold).

Note that regular scores (i.e. without Extra Yahtzee Bonus) are less than the Extra Yahtzee Bonus. Therefore, taking a score modulo the Extra Yahtzee Bonus means that this bonus is ignored. That is how the final scoring rules capture that Extra Yahtzee Bonuses do not count toward reaching the threshold for the Upper Section Bonus. Rather than including the Extra Yahtzee Bonus in the pattern score, it is more practical to record Extra Yahtzee Bonuses in a separate box.

© 1999, Tom Verhoeff (TUE, Math/CS)