0% found this document useful (0 votes)
926 views17 pages

Rock Paper Scissors Project Report

The document is a project report on the game Rock Paper Scissors, created by student Neev Chaprana for the Computer Science subject in Class XII at Eicher School. It outlines the project's objectives, including the development of a human vs. computer simulation, exploration of probability and game theory, and the creation of an engaging user interface. The report also includes acknowledgments, hardware and software requirements, source code, and testing procedures.

Uploaded by

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

Rock Paper Scissors Project Report

The document is a project report on the game Rock Paper Scissors, created by student Neev Chaprana for the Computer Science subject in Class XII at Eicher School. It outlines the project's objectives, including the development of a human vs. computer simulation, exploration of probability and game theory, and the creation of an engaging user interface. The report also includes acknowledgments, hardware and software requirements, source code, and testing procedures.

Uploaded by

neevchaprana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

EICHER SCHOOL

Project Report on
ROCK PAPER SCISSORS
for
Computer Science
Session:2024-25
NAME: Neev Chaprana
ROLL NUMBER:
CLASS: XII-A
SUB. CODE: 083
CERTIFICATE
This is to certify that cadet Neev
Chaprana Roll no: ………………………
has successfully completed the
project work entitled ROCK PAPER
SCISSORS in the subject Computer
science (083) laid down in the
regulations of CBSE for the purposes
of Practical examination in Class XII to
be held in Eicher School, Faridabad,
Haryana

Mrs. Lalita
PGT Computer Science

Examiner
Name:
Signature:

TABLE OF CONTENT
[Link] Description
1 ACKNOWLEDGEMENT
2 INTRODUCTION
3 OBJECTIVES OF THE
PROJECT
4 SYSTEM DEVELOPMENT
LIFE CYCLE(SDLO)
5 MODULES USED AND
THEIR PURPOSE
6 FLOW CHART
7 SOURCE CODE
8 OUTPUT
9 TESTING
10 HARDWARE AND
SOFTWARE
REQUIREMENT
11 INSTALLATION
PROCEDURE
12 BIBLIOGRAPHY

ACKNOWLEDGEMENT
Apart from my efforts, the success of any
project depends largely on the
encouragement and guidelines of many
others. I take this opportunity to express my
gratitude to the people who have been
instrumental in the successful completion of
this project.
I express my deep sense of gratitude to the
luminary The Principal who has been
continuously motivating and extending their
helping hand to us.
I express my sincere thanks to the
academician, the Vice Principal, for constant
encouragement and the guidance provided
during this project.
My sincere thanks to Mrs. Lalita,The guidance
and support received from all the members
who contributed and who are contributing to
this project, was vital for the success of the
project. I am grateful for their constant
support and help.

PROJECT ON
ROCK PAPER SCISSORS
INTRODUCTION
Rock, Paper, Scissors is a simple hand game
played between two participants, where rock
crushes scissors, scissors cuts paper, and
paper covers rock. Despite its simplicity, the
game offers insights into strategy, chance,
and decision-making. This project explores
the game’s dynamics, focusing on both
human vs. human and human vs. computer
interactions. We’ll examine how algorithms
can predict or improve decisions and discuss
how the game connects to concepts in
probability, game theory, and artificial
intelligence. Ultimately, this project highlights
Rock, Paper, Scissors as both entertaining and
educational tools.

Objectives of the Project


 Human vs. Computer Simulation:
Develop an algorithm to simulate a
computer opponent that can make
decisions based on randomness or
strategy.
 Explore Probability and Game Theory:
Investigate how probability theory applies
to Rock, Paper, Scissors and explore
strategies like the Nash Equilibrium.
 Algorithmic Decision Making: Design
and implement algorithms that enhance
decision-making in the game, potentially
using machine learning techniques.
 User Interface Development: Create an
engaging and user-friendly interface for
players to interact with the game, both for
human vs. human and human vs.
computer modes.
 Educational Insight: Demonstrate how
Rock, Paper, Scissors can be used as a
learning tool for introducing concepts in
computer science, probability, and AI.

HARDWARE AND
SOFTWARE
REQUIREMENTS
1. OPERATING SYSTEM: Windows 7 or Above
Mac OS X 10.11 or higher, 64-bit
Linux: RHEL 6/7, 64-bit
II. PROCESSOR: Intel(R) Core (TMi5-10400F
CPU @2.90GHz 2.90 GHz)
III. MOTHERBOARD: GIGABYTE B760M DS3H
AX DDR4 IV. RAM :8 GB+
V. HARD DISK: SATA 40 GB OR ABOVE
VI. CD/DVD r/w multi drive combo: (If back up
required)
VII. FLOPPY DRIVE: 1.44 MB (If Backup
required)
VIII. MONITOR :15-17 inch

PROJECT CODE
import random
import [Link]
from [Link] import Error

def connect_to_database():
try:
connection = [Link](
host="localhost",
user="root",
password="password",
database="rps_game" )
if connection.is_connected():
print("Connected to MySQL
database.")
return connection
except Error as e:
print(f"Error connecting to database:
{e}")
return None

def
insert_session_highest_winstreak(connection,
highest_winstreak):
try:
cursor = [Link]()
query = "INSERT INTO session_stats
(highest_winstreak) VALUES (%s)"
[Link](query,
(highest_winstreak,))
[Link]()
print(f"Session saved with highest win
streak: {highest_winstreak}")
except Error as e:
print(f"Error inserting data: {e}")

def get_user_choice():
print("Enter your choice: rock, paper, or
scissors")
while True:
choice = input("Your choice: ").lower()
if choice in ["rock", "paper", "scissors"]:
return choice
else:
print("Invalid choice. Please enter
rock, paper, or scissors.")
def get_computer_choice():
return [Link](["rock", "paper",
"scissors"])

def determine_winner(user_choice,
computer_choice):
if user_choice == computer_choice:
return "tie"
elif (user_choice == "rock" and
computer_choice == "scissors") or \
(user_choice == "paper" and
computer_choice == "rock") or \
(user_choice == "scissors" and
computer_choice == "paper"):
return "user"
else:
return "computer"
def main():
connection = connect_to_database()
if not connection:
print("Unable to connect to the
database. Exiting game.")
return

print("Welcome to Rock-Paper-Scissors with


Database-Tracked Win Streaks!")
win_streak = 0
highest_winstreak = 0

while True:
user_choice = get_user_choice()
computer_choice =
get_computer_choice()
print(f"\nYou chose: {user_choice}")
print(f"Computer chose:
{computer_choice}")

result = determine_winner(user_choice,
computer_choice)

if result == "user":
win_streak += 1
highest_winstreak =
max(highest_winstreak, win_streak)
print(f"\nYou win! Current win streak:
{win_streak}")
elif result == "computer":
print("\nComputer wins! Your win
streak has ended.")
win_streak = 0
else:
print("\nIt's a tie! Your win streak
continues.")
play_again = input("Do you want to play
again? (yes/no): ").lower()
if play_again != "yes":
print(f"\nYour highest win streak this
session: {highest_winstreak}")

insert_session_highest_winstreak(connection,
highest_winstreak)
print("Thanks for playing! Goodbye!")
break

if connection.is_connected():
[Link]()
print("Database connection closed.")

if __name__ == "__main__":
main()
Screenshot of the game
Photo of MYSQL

Common questions

Powered by AI

The hardware requirements include an Intel(R) Core (TMi5-10400F CPU @2.90GHz 2.90 GHz) processor, GIGABYTE B760M DS3H AX DDR4 motherboard, 8 GB+ RAM, SATA 40 GB or above hard disk, and a 15-17 inch monitor. The software requirements include an operating system of Windows 7 or Above, Mac OS X 10.11 or higher, or 64-bit Linux such as RHEL 6/7 .

Rock-Paper-Scissors is an exemplary educational tool for understanding probability and game theory because it is built on simple rules that lend themselves to deeper analysis. Probability is integral, as each choice has a one-third chance if decisions are made randomly. The game also exemplifies the Nash Equilibrium in game theory, where each player's strategy is optimal, given the opponent's strategy. This understanding helps in exploring strategic decision-making and the role of randomness in competitive scenarios, which are foundational concepts in both probability and game theory .

Data persistence in the Rock-Paper-Scissors project is achieved through a MySQL database, which stores session statistics such as the highest win streak. The database plays a critical role by providing a means to track and save game results beyond the current session, allowing users to maintain a record of their performances and potentially analyze their gaming patterns over multiple sessions .

Implementing user interface development in the Rock-Paper-Scissors game project provides educational insights such as enhancing human-computer interactions, understanding user experience design, and applying user feedback effectively. Developing a user-friendly interface requires critical thinking about how users interact with the game, which involves designing intuitive controls and clear visual feedback. Furthermore, this process can teach the iterative design approach, where user feedback informs subsequent development stages to improve the interface continually .

Flow charts are an important component in developing the Rock-Paper-Scissors game project because they provide a visual representation of the game logic and decision flow. They help in outlining the steps involved from user input to determining the winner, enhancing understanding of the process for developers. Flow charts also simplify debugging, as they allow developers to trace logical paths and identify potential issues or inefficiencies in the algorithm. This makes them a valuable tool for planning and maintenance phases .

In the Rock-Paper-Scissors game, algorithmic decision-making for the computer's choices is implemented using randomness to simulate unpredictability, which mimics human decision-making. The algorithm utilizes Python's 'random' module to generate one of the three possible outcomes: rock, paper, or scissors. While this basic form relies purely on random selection, it can be expanded using more complex algorithms or machine learning techniques to adapt the computer's strategy based on the player's patterns, which could introduce a strategic component beyond randomness .

The testing methods for the Rock-Paper-Scissors game likely include unit testing, integration testing, and user acceptance testing. Unit testing would focus on individual components, such as the function determining the winner or the database connection. Integration testing would verify that combined components operate together as expected, while user acceptance testing would involve real users validating that the game meets their expectations and functions reliably in real-world scenarios. These testing levels ensure both the functionality and user experience are maintained to high standards .

Rock-Paper-Scissors is simple because its rules are easily understood and accessible to anyone. However, randomness introduces an element of unpredictability essential for fairness, while strategy involves anticipating the opponent's moves for an advantage. This dichotomy creates complexity, as players must balance randomness to prevent predictability while employing strategy to out-think opponents. This complexity allows for deeper exploration into decision-making processes and strategic behaviors, making it a rich subject for analysis .

The Nash Equilibrium in Rock-Paper-Scissors is achieved when both players employ strategies yielding no unilateral advantage, assuming rational behavior. In this context, players should use each option (rock, paper, scissors) with equal probability to ensure unpredictability. This equilibrium reflects an optimal strategy, as deviating from the 1/3 distribution allows the opponent an exploitable pattern. Understanding this theoretical balance highlights the importance of randomness and strategic diversity in competitive scenarios .

Machine learning could be applied to the Rock-Paper-Scissors game to enhance decision-making by using historical data of the user's choices to detect patterns and predict future moves. Algorithms such as neural networks or decision trees could learn from past games to identify likely user strategies, allowing the computer then to adjust its choices to maximize its win rate. Additionally, reinforcement learning could be implemented to allow the computer to continually adapt its strategy based on outcomes, aiming to achieve an optimized strategy dynamically .

You might also like