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

  Plot the distribution of the rate using histograms

Write a function using only list comprehensions, no loops, to compute Standard Deviation. Print the Standard Deviation of each numeric column.

  Write a python program that inputs a polynomial

Write a Python program that inputs a polynomial in standard algebraic notation and outputs the first derivative of that polynomial.

  What is the speed of the shuttle 10 seconds after lift-off

During the lift-off, the net force on the shuttle is 1.9X107 newtons directed upward. What is the speed of the shuttle 10 seconds after lift-off

  Write a program that takes a value from a user

Write a program that takes a value from a user and stores it in the registry. You can use any key name that you like but also store the current time as another value inside of your new key

  Data wrangling - child mortality

ICT702 - Data Wrangling - Child Mortality - Develop creative approaches to solving the wrangling/analysis problems - Write programs that produce correct

  Can you improve the algorithm from the given problem

Devise an experiment to verify that the list index operator is O(1) . Can you improve the algorithm from the previous problem to be linear? Explain.

  Most popular name would be the one with the biggest number

the program will ask you to insert the year that the user is interested in, then ask the gender that the user is interested in, and print out the most popular names corresponding to the year and gender. FYI, the number on the right represents how man..

  Write a fuunction that computes future investment value

Write a fuunction that computes future investment value at a given interest rate for a specified number of years.

  Create a new pandas dataframe of data that will be used

Provide a count of the number of records. Create a new pandas DataFrame of data that will be used for target maketing and write it out to a headered csv file.

  What is the difference between a for loop and a while loop

Explain how to use built-in functions, functions from module, and user-defined functions. What is the difference between a for loop and a while loop? What is the difference between elif and if-else?

  Turn the turtle image into a .gif picture

How can you turn the turtle image into a .gif picture when using the built-in turtle for Python? If that's impossible how do you remove the line when you move the turtle around?

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

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