Thanks for any help!
Mike
AI in Yahtzee
after the first roll, and the second roll, the computer would evaluate the chances of getting each configuration, and pick the greatest chance. equal chances go to the configuration that gets the most score. of course, it does not calculate odds for for configurations already achieved.
also, besides the "junk" configuration, the computer treats the 1's, 2's, 3's as junk, since they make only a few points.
for example:
first roll:
5,5,4,1,6
to get a yachtzee, the computer would have to re-roll the 4,1, and 6, with only a 1/216 chance of getting it.
to get a large straight, the computer would only have to reroll either a 5 and the 1, or a 5 and a 6 (either way, two dice, for a chance of 1/36)
to get a full house, the computer would keep the 5's, and one other die. two dice, chance of 1/36
and so on, to calculate all of the possibilities.
i dont know the scoring scheme for the configs, so i'll say for the moment that the computer will go for a full house because it gets more points, and has a 1/36 chance.
so, the computer keeps the 5, 5, and 4, and rerolls the 1 and 6.
then rolls: 3,6
so, 5,5,4,3,6 is what it now has.
recalculating, we already have a small straight, and we have a 1/6 chance for getting a large straight, and for anything else there is at MOST a 1/36 chance, so the computer rerolls one of the 5s
and, he gets a 1, so we have a small straight.
but this is, IMO, how a yachtzee AI should work.
Get off my lawn!