0% found this document useful (0 votes)
18 views18 pages

Mini Project

Uploaded by

shek25945
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views18 pages

Mini Project

Uploaded by

shek25945
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

A PROJECT REPORT ON

“ROCK PAPER SCISSOR GAME”


Bachelor of Technology
In

COMPUTER SCIENCE ENGINEERING


Submitted By
B. AMIT 22D01A0522
B. CHAITANYA 22D01A0525
E. DAYASAGAR 22D01A0566
G. SAI KUMAR 22D01A0570
H. HARI PRIYA 22D01A0584

Department of Computer Science Engineering

Under the Guidance of


Ms. Geetha

St. Mary’s Group of Institutions


(Affiliated to JNTU, Hyderabad)
Deshmukhi (V), Hayathnagar (M), R.R. District – 508284

JAWAHARLAL NEHRU TECHNILOGICAL UNIVERSITY

HYDERABAD – 500072

(2024-2025)
UNDERTAKING

We hereby declare that the results embodied in this dissertation entitled


“ROCK PAPER SCISSOR GAME”, is carried out by us during the year 2022-2026.
In partial fulfillment of the award of Degree of Bachelor of Technology in
Computer Science & Engineering from St. Mary’s Group of Institutions,
Hyderabad. We have submitted the same to any other university and
organization for the award of any other degree.

Students Name

B. AMIT (22D01A0522)
B. CHAITANYA (22D01A0525)
E. DAYASAGAR (22D01A0566)
G. SAI KUMAR (22D01A0570)
H. HARI PRIYA (22D01A0584)

Place: Hyderabad
CERTIFICATE

This is to certify that the project work “ROCK PAPER SCISSOR GAME” is
submitted in partial fulfillment of the requirement for the award of the Degree
Bachelor of Technology in COMPUTER SCIENCE & ENGINEERING from
JAWAHARLAL TECHNOLOGICAL UNIVERSITY, HYDERABAD is a bonafide work
carried under the guidance of Ms. Geetha

S. No Name Of the Students Hall Ticket No.


1 B. AMIT 22D01A0522
2 B. CHAITANYA 22D0A10525
3 E. DAYASAGAR 22D01A0566
4 G. SAI KUMAR 22D01A0570
5 H. HARI PRIYA 22D01A0584
Acknowledgements

We would like to thank Dr. Joy, HOD St. Mary’s Group of Institutions.
We are deeply indebted to our mentor Ms. Geetha
We further thank to all the staff members of St. Mary’s Group of
Institutions.
We owe our sincere gratitude towards St. Mary’s Group of Institutions.
Our heartfelt thanks to JNTU.
We also express our deepest gratitude to our parents.
Finally, we would like to wind up by paying our heartfelt thanks to all our
near and dear ones.

B. AMIT 22D01A0522
B. CHAITANYA 22D01A0525
E. DAYASAGAR 22D01A0566
G. SAI KUMAR 22D01A0570
H. HARI PRIYA 22D01A0584
CONTENTS

1. Abstract of Project.
2. Introduction of the Project.
3. Problem Statement.
4. Software Requirements & Software Environment.
5. Python Coding.
6. Output of the Project.
7. Compiled Output.
8. Conclusion.
9. Future Enhancements.
10. Bibliography / References
Abstract of Project

"Rock, Paper, Scissors" is a simple yet engaging hand game that is widely used for
decision-making or as a pastime activity. The game involves two players who
simultaneously form one of three shapes with an outstretched hand: rock (a fist),
paper (an open hand), or scissors (a fist with the index and middle fingers extended,
forming a V). The rules are straightforward:

• Rock crushes scissors (rock wins)


• Scissors cuts paper (scissors wins)
• Paper covers rock (paper wins)

In each round, players count to three and reveal their chosen shape simultaneously.
The winner is determined based on the interactions mentioned above. If both players
choose the same shape, the round is a tie and no points are awarded.

The simplicity of "Rock, Paper, Scissors" makes it accessible to players of all ages
and backgrounds. It requires no special equipment and can be played anywhere,
making it a versatile and portable game. The game also introduces elements of
strategy and psychology, as players may attempt to predict and counter their
opponent's choices.

Overall, "Rock, Paper, Scissors" is a timeless and universally recognized game that
combines luck, strategy, and quick decision-making, offering both entertainment and
a method for resolving minor disputes in a fair and enjoyable manner.
Introduction of the Project

The Rock, Paper, Scissors game implemented in Python provides a


classic yet engaging interactive experience within a console
environment. This project demonstrates fundamental programming
concepts such as user input handling, random number generation,
conditional statements, and loop structures. The game allows players to
choose between three options—rock, paper, or scissors—while
competing against the computer. Each round's outcome is determined
based on simple rules: rock crushes scissors, scissors cuts paper, and
paper covers rock. The game continues until the player decides to quit,
providing a fun and educational exercise for learning Python basics or
reinforcing existing programming skills. The console-based interface
ensures accessibility and simplicity, catering to users of all skill levels.
Problem Statement

The Python-based Rock, Paper, Scissors game aims to achieve the following objectives:

1. Game Logic Implementation: Develop a program that allows players to


interactively play the classic game of Rock, Paper, Scissors against the
computer.

2. User Interaction: Create a user-friendly console interface where players can


input their choices (rock, paper, or scissors) and view the computer's
randomly generated choice for each round.
3. Game Mechanics: Implement the game's rules:
a. Rock beats scissors
b. Scissors beat paper
c. Paper beats rock
4. Score Tracking: Keep track of and display the player's and computer's
scores after each round.
5. Game Continuity: Allow players to continue playing multiple rounds until they
choose to quit the game.
6. Error Handling: Handle invalid inputs gracefully, providing clear instructions
and prompts for correct user interaction.
Software Requirements & Software Environment

Software Requirements
• Python 3.8+: The core programming language for developing the
application.

Software Environment

• Operating System: The application should be compatible with major


operating systems, including Windows, macOS, and Linux.

• Integrated Development Environment (IDE): Recommended IDEs


include PyCharm, VS Code, or any text editor that supports Python
development, such as Sublime Text or Atom.

• Python Package Manager (pip): For installing and managing Python


packages and dependencies.

• Version Control System (Git): For tracking changes, collaborating


with others, and maintaining the project’s source code.
Code:
import random

class RockPaperScissors:

def __init__(self):
self.choices = ["rock", "paper", "scissors"]

self.player_score = 0

self.computer_score = 0

def play_game(self):
print("Welcome to Rock, Paper, Scissors Game!")
while True:
print("\nChoose your move:")

print("1. Rock")
print("2. Paper")

print("3. Scissors")

print("4. Quit")

player_choice = input("Enter your choice (1-4): ")

if player_choice == '4':

print("Exiting game. Final Scores:")


self.display_scores()

break
elif player_choice in ['1', '2', '3']:
player_move = self.choices[int(player_choice) - 1]

computer_move = random.choice(self.choices)
print(f"\nYou chose: {player_move}")

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

result = self.determine_winner(player_move, computer_move)

if result == 'win':

self.player_score += 1
print("You win this round!")

elif result == 'lose':


self.computer_score += 1

print("Computer wins this round!")

else:
print("It's a tie!")

self.display_scores()

else:

print("Invalid choice. Please choose again.")

def determine_winner(self, player_move, computer_move):


if player_move == computer_move:

return 'tie'
elif (player_move == 'rock' and computer_move == 'scissors') or \
(player_move == 'paper' and computer_move == 'rock') or \
(player_move == 'scissors' and computer_move == 'paper'):

return 'win'
else:

return 'lose'

def display_scores(self):

print(f"Your score: {self.player_score}")

print(f"Computer's score: {self.computer_score}")

def main():
game = RockPaperScissors()

game.play_game()

if __name__ == "__main__":
main()
Output:

Welcome to Rock, Paper, Scissors Game!

Choose your move:

1. Rock

2. Paper

3. Scissors

4. Quit

Enter your choice (1-4): 1

You chose: rock

Computer chose: scissors


You win this round!

Your score: 1

Computer's score: 0

Choose your move:

1. Rock

2. Paper

3. Scissors

4. Quit
Enter your choice (1-4): 2

You chose: paper

Computer chose: scissors


Computer wins this round!
Your score: 1

Computer's score: 1

Choose your move:

1. Rock
2. Paper

3. Scissors

4. Quit
Enter your choice (1-4): 4

Exiting game. Final Scores:

Your score: 1

Computer’s Score: 1
Compiled Output:
Conclusion:

In conclusion, the Rock, Paper, Scissors game developed in Python


provides an interactive and educational experience for users interested
in programming and game development. By implementing core Python
concepts such as conditionals, loops, and random number generation,
this project offers a hands-on approach to learning and practicing
programming skills. The console-based interface ensures accessibility
and ease of use, making it suitable for beginners and experienced
programmers alike. Moving forward, enhancements could include adding
graphical user interfaces (GUIs), implementing advanced game modes
or AI opponents, and incorporating multiplayer functionality. Overall, this
project serves as both a practical introduction to Python programming
and a fun application for leisure and learning.
Future Enhancements
"In future iterations, the rock-paper-scissors game could include varying
difficulty levels for the computer opponent, utilizing advanced algorithms to
challenge users of different skill levels effectively. A graphical user interface
(GUI) powered by Tkinter or Pygame would enhance user interaction and visual
appeal, offering a more immersive gaming experience. Additionally, multiplayer
functionality could enable online play, allowing friends to compete remotely
and adding a social dimension to the game."

1. "Implementing a statistics feature would enable players to track their


performance, including win-loss records and gameplay trends over time.
Expanding beyond traditional choices to include additional options like
lizard and Spock could deepen gameplay strategy and appeal to a
broader audience. Lastly, incorporating sound effects and animations
would elevate the gaming experience, making it more dynamic and
enjoyable for players of all ages."

"By combining these enhancements, future versions of the rock-paper-scissors


game aim to provide a comprehensive and engaging gaming experience. These
improvements not only cater to varying skill levels and preferences but also
introduce new dimensions such as multiplayer interaction and statistical
analysis, enriching the game's overall appeal and longevity in the
gaming community."
Bibliography / References

1. Python.org
2. GeeksforGeeks
3. Chatgpt.AI
4. Perplexity.AI
5. Code Academy
6. PythonChallenge.com

You might also like