Lab 12: 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 starting 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.

This Die class is not exactly the same as the Die class from your earlier lab and exercise. Follow the UML exactly

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.

Due at the beginning of lab: You must create the interface and all of the classes shown in the UML diagram. You must have stub implementations of all of the methods implemented. The program does not need to be functional, but the project must compile without any errors prior to lab.

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.