Lab 3: The Game of Pig

Objectives

Resources

Introduction

In this assigment you will make a simple console implementation of the traditional dice jeopardy game Pig. Your implementation will allow for both human and AI ("bot") players.

The Game of Pig

Pig is a traditional dice jeopardy game. Players take turns, starting with a randomly chosen player. On their turn a player rolls a single 6-sided die 1 or more times. After each roll, the player has a choice:

A player's turn ends when they roll a 1 or choose to hold. The first player to reach 100 points is the winner.

Software Design

You implementation should match the UML diagram below. The Pig class is included in the repository, but you will need to write the other classes yourself. You will also notice that there is a Die class for this game as well. Your Die class implementation must adhere to the design specified in this UML diagram.

All of the classes should be located in a package whose name matches your MSOE username.

The Players class hierarchy is used to specialize different types of players. While the game treats all players equally, there are some differences.

If you have any questions about what a method should do, ask your instructor.

Sample Run

Acknowledgment

This laboratory assignment was developed by Dr. William Retert and the CS1021 instructors.

See your professor's instructions for details on submission guidelines and due dates.