Final answer:
The Rock, Paper, Scissors Python program can be modified by implementing a user input for naming, checking for pre-existing files, tracking scores, and updating them after playing. The scores are saved and can be graphed using Excel, with the results being publishable on a class webpage.
Step-by-step explanation:
Modifying the Rock, Paper, Scissors Python Program-
To modify the Rock, Paper, Scissors Python program to count wins, losses, and ties and store them in a file, we need to write a program that accomplishes several tasks. First, the program must prompt the player for their name and check if a player file already exists. If it doesn't, the program should create a new one. Then, the program must track and update the player's scores, save them to the hard drive, and allow for their importation into Excel for graphing purposes. Publishing to a webpage entails additional steps and may require knowledge of web development or integration with a service that can display the graphs.
Extract of the Python Program-
The main structure of the Python script consists of:
- Asking for player's name and handling file operations for reading or creating player score file.
- Running the game while keeping track of the scores using a loop.
- Updating the results in the file after the game session ends.
- Exporting the game statistics to an XML file that can be used in Excel.
- Graphing the results using Excel's capabilities or Python's plotting libraries.
- Publishing the graphs to a class webpage, which can be handled by an additional script or manual upload.
CODE to keep track of the scoring will be managed by a dictionary with keys 'wins', 'losses', and 'ties', and their corresponding counts as values. Each game round's outcome will update this dictionary.