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 python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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