0% found this document useful (0 votes)
18 views

Rock_Paper_Scissors_Mini_Project_Report_With_Flowchart (1)

This mini project report details the implementation of a Rock, Paper, Scissors game using Python, focusing on basic programming concepts such as loops, conditional statements, and user input. The game allows users to play against the computer, with the computer's choice generated randomly, and continues until the user decides to exit. Future enhancements include adding a graphical interface, score tracking, multiplayer functionality, and difficulty levels.

Uploaded by

py9502693
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Rock_Paper_Scissors_Mini_Project_Report_With_Flowchart (1)

This mini project report details the implementation of a Rock, Paper, Scissors game using Python, focusing on basic programming concepts such as loops, conditional statements, and user input. The game allows users to play against the computer, with the computer's choice generated randomly, and continues until the user decides to exit. Future enhancements include adding a graphical interface, score tracking, multiplayer functionality, and difficulty levels.

Uploaded by

py9502693
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Mini Project Report

Rock, Paper, Scissors Game Using Python

Introduction

This project is a simple implementation of the classic game 'Rock, Paper, Scissors' using the Python

programming language. The objective of this mini-project is to demonstrate the basic concepts of Python

such as conditional statements, loops, user input, and random module usage.

Objective

To design a terminal-based Rock, Paper, Scissors game where a user plays against the computer. The game

randomly generates the computers choice and determines the winner based on traditional game rules.

Tools and Technologies

- Programming Language: Python 3.x

- IDE: Any Python IDE or code editor (e.g., VS Code, PyCharm, IDLE)

- Modules Used: random

System Requirements

- Python 3.x installed

- Basic system with command-line access

- Optional: Python-compatible IDE for development

Project Description

The game works as follows:

1. The user is prompted to enter their choice: rock, paper, or scissors.


Mini Project Report
Rock, Paper, Scissors Game Using Python

2. The computer randomly selects its choice using the random.choice() function.

3. The program compares both choices using conditional logic.

4. The winner is declared based on the following rules:

- Rock beats scissors

- Scissors beat paper

- Paper beats rock

5. The game loops until the user decides to exit.

Source Code

import random

def get_computer_choice():

return random.choice(['rock', 'paper', 'scissors'])

def get_user_choice():

return input("Enter rock, paper or scissors: ").lower()

def determine_winner(user, computer):

if user == computer:

return "It's a tie!"

elif (user == 'rock' and computer == 'scissors') or \

(user == 'paper' and computer == 'rock') or \

(user == 'scissors' and computer == 'paper'):


Mini Project Report
Rock, Paper, Scissors Game Using Python

return "You win!"

else:

return "Computer wins!"

def play_game():

while True:

user = get_user_choice()

if user not in ['rock', 'paper', 'scissors']:

print("Invalid input. Try again.")

continue

computer = get_computer_choice()

print(f"Computer chose: {computer}")

result = determine_winner(user, computer)

print(result)

play_again = input("Play again? (yes/no): ").lower()

if play_again != 'yes':

break

play_game()

Output

Example output:

Enter rock, paper or scissors: rock


Mini Project Report
Rock, Paper, Scissors Game Using Python

Computer chose: scissors

You win!

Play again? (yes/no): no

Conclusion

This project is a simple yet effective way to apply basic programming concepts in Python. It helps in

understanding user input handling, logic building, and use of built-in modules like random.

Future Enhancements

- Add a graphical user interface (GUI) using tkinter.

- Implement a score tracker.

- Enable multiplayer functionality.

- Add difficulty levels or a time-based challenge.

Flowchart
Mini Project Report
Rock, Paper, Scissors Game Using Python

References

1. Python Documentation - https://docs.python.org/3/

2. W3Schools Python Tutorial - https://www.w3schools.com/python/

3. GeeksforGeeks Python Examples - https://www.geeksforgeeks.org/python-programming-examples/

4. Stack Overflow Community Discussions - https://stackoverflow.com/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy