Assignment 1
Assignment 1
Project Structure:
Your project folder must be named rock_paper_scissors and organized using the following
structure:
rock_paper_scissors/
├── main.py
├── game/
│ ├── __init__.py
│ ├── logic.py
│ └── utils.py
└── tools/
└── display.py
The main.py file should serve as the entry point of your program, containing only the top-
level logic. All helper functions should be kept in their respective modules inside the game/
and tools/ folders.
The greeting message and the formatted print statements used for displaying messages and
scores should be placed inside a separate display.py file under the tools/ folder.
Implementation Tasks:
Start with main.py. Ask the user to enter their name. Then, display a welcome message using
a function from tools/display.py. This function should use an f-string to include the user's
name.
Import it with an alias, for example:
The game then enters a loop where the user is prompted to enter one of the following valid
moves: "rock", "paper", or "scissors". Use a helper function from game/utils.py to clean the
user input by stripping extra spaces and converting it to lowercase.
After each round, main.py should print the computer’s move and the result of the round
using functions from tools/display.py. It should then update and print the current score in
the following format:
User: 2
Computer: 3
The game should continue until the user types "exit". You must demonstrate usage of at least
three different import styles across the project:
• import module
Sample Gameplay:
Welcome, Alice!
Let's play Rock, Paper, Scissors.
(Type 'exit' to quit.)
Score:
User: 1
Computer: 1
Submission Instructions:
After testing your project by running only main.py, compress the entire rock_paper_scissors/
folder and submit it as a .zip file.