Week 8 Assignment Design Patterns Overview
This week, we reviewed Design Patterns and learned how they can make your OOP programs more structured and more easily readable by fellow programmers. Last week’s assignment you designed a program to implement the game of Pig. This week, we will expand on that game by using a few patterns that we have learned, specifically the Proxy and Factory patterns.
3. Before submitting the assignment, review the “Functional Requirements” section and make sure you hit all the points. This will not guarantee a perfect score, however.
Extending our Design
In order for the computer to make decisions in this game, the computer must have some kind of strategy.
For this assignment, have the computer use the following strategy: given the computer's score x, the computer will hold at the lesser of 25 and 100 x; otherwise, the computer will roll. This strategy should be implemented in a new class, called ComputerPlayer, that inherits from the Player base class.