Farkle Bots

Write a bot to play Farkle.

In this assignment, you will create an AI bot that plays the dice game Farkle. Your bot will compete in a tournament against bots created by other students.

The Game

Farkle is a dice game where players take turns rolling six dice and scoring points based on certain combinations. The goal is to be the first player to reach 10,000 points.

Basic Rules:

Task

  1. Create a bot file - extend the FarkleBot base class to create your own bot. Name it with your real name (ex: BradfieldBot)
  2. Develop a decision making strategy for your bot.
  3. Test your bot by running it against an example bot.
  4. Submit your bot and it will battle against the others.

Getting started

Copy the bot_template.py file and rename it for your own bot. This is the only file you need to edit.

Your bot must implement the make_decision method:

def make_decision(self, state: TurnState) -> BotDecision:
    """
    Make a decision based on the current game state

    Args:
        state: The current turn state

    Returns:
        A BotDecision object with which dice to keep and whether to roll again
    """

The TurnState object contains all the information your bot needs to make its decision:

Return a BotDecision object with:

Helper functions

Example Bots

The setup includes two example bots you can look at for reference:

Testing your bot

You also have a program called test.py that will run your bot against SimpleBot and show what it’s doing.

Submitting your bot

Instructions TBD