diff_months: 21

 Rock Paper Scissors Programming Project IT Assignment Help

Flat 50% Off Order New Solution
Added on: 2022-08-20 00:00:00
Order Code:
Question Task Id: 381715
  • Country :

    Australia

Assignment Task
 

STARTER CODE
This program plays a game of Rock, Paper, Scissors between two Players,

  • and reports both Player's scores each round."""
  • moves = ['rock', 'paper', 'scissors']
  • The Player class is the parent class for all of the Players
  • in this game"""
  • class Player:
  • def move(self):
  • return 'rock'
  • def learn(self, my_move, their_move):
  • pass
  • def beats(one, two):
  • return ((one == 'rock' and two == 'scissors') or
  • (one == 'scissors' and two == 'paper') or
  • (one == 'paper' and two == 'rock'))
  • class Game:
  • def __init__(self, p1, p2):
  • self.p1 = p1
  • self.p2 = p2
  • def play_round(self):
  • move1 = self.p1.move()
  • move2 = self.p2.move()
  • print(f"Player 1: {move1} Player 2: {move2}")
  • self.p1.learn(move1, move2)
  • self.p2.learn(move2, move1)
  • def play_game(self):
  • print("Game start!")
  • for round in range(3):
  • print(f"Round {round}:")
  • self.play_round()
  • print("Game over!")

 


Here are some steps to get you started in the Rock Paper Scissors project! As you work through the project, make sure to test your program by running it.
1
. Download the starter code The starter code gives you a place to begin, with Player and Game classes that are mostly empty. Over the course of the project, you will be greatly expanding the classes and methods in this program. Read the starter code, and run it on your computer to see what it does. Try importing it into the Python interpreter and experimenting with the Player and Game objects.
2. Create a player subclass that plays randomly The starter Player class always plays 'rock'. That's not a very good strategy! Create a subclass called RandomPlayer that chooses its move at random. When you call the move method on a RandomPlayer object, it should return one of 'rock', 'paper', or 'scissors' at random. Change the code so it plays a game between two RandomPlayer objects.
3. Keep scoreThe starter Game class does not keep score. It doesn't even notice which player won each round. Update the Game class so that it displays the outcome of each round, and keeps score for both players. You can use the provided beats function, which tells whether one move beats another one.
4. Create a subclass for a human player. The game is a lot more interesting if you can actually play it, instead of just watching the computer play against itself. Create a HumanPlayer subclass, whose move method asks the human user what move to make. (Take another look back at the project demo to see what this can look like!) Set the program to play a game between HumanPlayer and RandomPlayer.
5. Create player classes that remember
At the end of each game round, the Game class calls the learn method on each player object, to tell that player what the other player's move was. This means you can have computer players that change their moves depending on what has happened earlier in the game. To do this, you will need to implement learn methods that save information into instance variables. Create a ReflectPlayer class that remembers what move the opponent played last round, and plays that move this round. (In other words, if you play 'paper' on the first round, a ReflectPlayer will play 'paper' on the second round.)
    


This IT Assignment has been solved by our IT Experts at Exam Question Bank. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
    
Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

  • Uploaded By : KHUSHWANT
  • Posted on : December 08th, 2019
  • Downloads : 0
  • Views : 426

Order New Solution

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more