DEV Community

oaltena
oaltena

Posted on

Write an AI for Yahtzee

Hello everyone!

I would like to develop an AI for Yahtzee.
I would like to train the AI with my own playing strategy so that I can play against myself at a later time.
How do I approach this project?
What topics do I have to deal with?
What kind of AI is necessary here?

Top comments (1)

Collapse
 
benchislett profile image
Benjamin Chislett

Because of the turn-based and random natures of Yahtzee, you're going to want to look into Reinforcement Learning.

In short, this is a learning model that experiments and learns from how it has done in previous turns. This is the most general form, and doesn't require much input. Because you said you want it to use your own playing strategy though, you might want to play around with some hard-coded (non-ai) programs before you get into the heavy stuff.

A quick github search yields some results in various languages: have a look, and see how much you understand. Do not just copy code; you won't learn a thing
github.com/search?q=yahtzee+ai

For RL, you can start with the wikipedia page and then try out some packages in different languages, and see what comes out.
en.wikipedia.org/wiki/Reinforcemen...

Good luck, and have fun!