Review the functional requirements section

Assignment Help Python Programming
Reference no: EM132192472

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.

Make sure to create a github repository. All development should be done in this repository.

Useful Reminders

1. Read the assignment over a few times. At least twice. It always helps to have a clear picture of the overall assignment when understanding how to build a solution.

2. Think about the problem for a while, and even try writing or drawing a solution using pencil and paper or a whiteboard.

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

For this assignment, we will expand on last week's assignment in two ways:

1. You will now be able to play against the computer, where the computer will follow some predefined strategy

2. You can now play a timed version of the game: if the game lasts longer than one minute, the winner is whoever had the most points at the time.

You will implement the computer player as an inherited class from the base Player class. This will help differentiate the computer player from a human one, which will be in its own class. You will also design a PlayerFactory class, that will instantiate the correct Player class. For the timed version of the game, you will implement this as a Proxy pattern on the Game class. This class will use all the same methods as the Game class, but will keep track of time and when time is up, determine a winner.

Playing Against the Computer

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.

To determine what kind of players to use, your program should now accept two arguments, a --player1 and --player2 argument, each of which can be "human" or "computer". Yes, your computer can potentially have two computer players playing against one another.

Now that you have a new class, you should design a Factory class that will instantiate either a human or computer player, depending on the input. The Game class should use this Factory when initializing the game
Timed Version of Pig

Your next task is to write a Proxy to the Game class, called TimedGameProxy, which will follow all the same exact rules of Pig as before, but will introduce a timed aspect: the game will continue until either someone scores 100, or one minute has elapsed since the start of the game. This proxy should keep track of the time the game starts, and should check that no more than one minute has gone by since then at every step. In order to activate this feature, your program should take in a --timed parameter.

Attachment:- Assignment.rar

Verified Expert

Added the code for TimedGameProxy for finishing the game in a period of time. Game class is added for giving proxy which was inherited by the TimedGameProxy. Added the Player class for the program should accept two arguments at same time. Added the ComputerPlayer class for holding the computer when the score at the lesser of 25 and 100 x

Reference no: EM132192472

Questions Cloud

A definition of fostering student ownership : Explanation of the relationship between motivation and engagement in helping students build self-direction and ownership of learning.
When party sues to enforce alleged contract : Which of the following is a requirement made by the Statute of Frauds when a party sues to enforce an alleged contract?
Identify and describe the core values of the natasha house : State how those core values contribute to the well-being of individuals, groups, societies, or international communities.
Statements best defines power of attorney : Which of the following statements best defines a power of attorney? Which of the following is true of duties that an employee has toward the employer?
Review the functional requirements section : Review the Functional Requirements section and make sure you hit all the points. This will not guarantee a perfect score, however
Explain how upholding these values might contribute : Post a brief description of the societal issue you selected (Bullying). Then, explain the values that give rise to your passion for this issue.
Health information technology certification for new product : It has decided to obtain the Office of the National Coordinator (ONC) for Health Information Technology’s certification for this new product.
How high entry barriers into a market influence given terms : In an eight. to 10.page paper. describe each market structure discussed in the course (perfect competition. monopolistic competition. oligopoly, monopoly).
Their participation in the risk management process : Why is it important to invite relevant stakeholders and seek their participation in the risk management process.

Reviews

len2192472

12/12/2018 11:43:22 PM

This assignment is to be based on a previous game assignment which I have included. This is easier than the first assignment and just builds on it. The assignment should be completed at the undergrad level. I have included the game it is based on in a zip file.

len2192472

12/12/2018 11:42:09 PM

Make sure to create a github repository for this assignment named IS211_Assignment8. All development should be done in this repository. This proxy should keep track of the time the game starts, and should check that no more than one minute has gone by since then at every step. In order to activate this feature, your program should take in a --timed parameter.

Write a Review

Python Programming Questions & Answers

  Write a program in python to draw a simplified face

Write a program in Python to draw a blue triangle in a drawing window. Write a program in Python that moves the triangle in an animated movement. Write a program in Python to draw a simplified face.

  Exploration of online social networking

This assignment will allow you to do a more open-ended exploration of online social networking. The goal is to let you use some of the tools we've learned in class on your own

  Write multiple functions in a single python file

File Functions - For this assignment, you will write multiple functions in a single Python file names file_functions.py?

  Identify the top three comments made in given survey

Identify the top three comments made in survey years 2015 and 2016. Report the top three most common comments based on their relative frequency.

  Do basic trigonometry functions

Create a program that allows the user to do basic trigonometry functions. First, ask the user if he or she would like to do sine, cosine, or tangent (sin, cos, tan).

  Assume that the variables gpa , deanslist and studentname

Assume that the variables gpa , deansList and studentName , have been initialized. Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.

  Input a temperature as a floating point

Your program should input a temperature as a floating point number with an appended unit letter. It should then print the temperature in all four of the units above

  Mathematical equation recognizer in python language

You need to prepare a mathematical equation recognizer in python language. Just need you to clear the errors and make it workable

  Programmer does not have to use the def statement

Unlike Z+-, the programmer does not have to use the DEF statement to create a variable. Instead, the programmer can simply use the variable. The first use of the variable creates it and initializes it to 0.

  Same directory as your program

In the same directory as your program, create a file FF1, and write into it Hello (with a space at teh end). Similarly, create a file FF2, and write into it world! (with a new line, i.e., an ENTER at the end). And create a file DD and write into i..

  Simulate the real-time data from two sensors

The task is to get real-time data from two sensors connected to Raspberry Pi 3 GPIO. What you can do is simulate random values from 0-10 for both sensors

  Write a password generator in python

Write a password generator in Python. Be creative with how you generate passwords - strong passwords have a mix of lowercase letters, uppercase letters.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd