Rps Mini Project Final - Removed
Rps Mini Project Final - Removed
This project involves the development of a Python program to simulate the classic game Rock, Paper, Scissors. The
game is designed for a single user to play against the computer, which generates its moves randomly. Key features
of the program include:
- Random Choice Generation: The computer's move is selected randomly from the three possible options: rock,
paper, or scissors.
- User Input Handling: The program accepts the user's input, ensuring it is valid and prompting for re-entry if
necessary.
- Game Logic Implementation: The program determines the outcome of each round based on the established rules
of Rock, Paper, Scissors:
- Rock crushes Scissors
- Scissors cuts Paper
- Paper covers Rock
- Result Display: After each round, the program displays the choices made by both the user and the computer, and
announces the winner or if the round is a tie.
- Replay Option: The user is given the option to play multiple rounds until they decide to quit.
The program demonstrates fundamental programming concepts such as input validation, control structures (loops
and conditionals), and random number generation, making it an excellent exercise for beginners learning Python.
The simplicity of the game's rules combined with the interactive nature of the program provides a practical and
engaging way to understand basic programming principles.
i
CONTENTS
4. CONCLUSION 9
ii
ROCK, PAPER AND SCISSORS 2023-24
CHAPTER 1
INTRODUCTION
This program allows you to play the classic hand game against the computer. The rules are simple:
- Rock beats Scissors
- Scissors beats Paper
- Paper beats Rock
In this program, you will be prompted to enter your choice of "Rock", "Paper", or "Scissors". The computer will then
randomly select its choice, and the winner will be determined based on the rules above. The result of each game will
be displayed, and you will have the option to play again or exit the game.
This project is a fun way to practice basic Python concepts such as:
- User input and output
- Random number generation
- Conditional statements
- Loops
This introduction sets the stage for the user, explaining what the program does, the basic rules of the game, and the
Python concepts involved.
1.1 OBJECTIVE
The objective of this Python program is to simulate the traditional game of Rock, Paper, Scissors, allowing a user to
play against the computer. The program aims to:
1. Provide an Interactive Experience: Engage the user by prompting for their choice and displaying the computer’s
choice and the outcome of each round.
2. Practice Basic Python Skills: Help learners practice essential Python programming skills, including handling user
input, generating random choices, using conditional statements to determine the winner, and implementing loops for
repeated play.
3. Enhance Problem-Solving Abilities: Develop problem-solving skills by translating the game rules into a functional
program logic.
4. Deliver a Fun and Educational Tool: Offer an enjoyable and educational experience that can be extended or
modified for further learning and experimentation with Python.
Page 1|9
1
ROCK, PAPER AND SCISSORS 2023-24
1.2Background Information
Rock, Paper, Scissors is a simple hand game that is often used as a decision-making tool, much like flipping a coin
or drawing straws. The game is believed to have originated in China over 2,000 years ago and has spread globally,
becoming a popular method for resolving minor conflicts and making decisions in a fun and fair way.
In recent years, the game has been adapted into various digital formats, including simple programs and apps.
Implementing Rock, Paper, Scissors in Python is an excellent beginner project for those learning programming. It
introduces fundamental concepts such as:
- User input and validation
- Random number generation and its application in simulating choices
- Conditional logic for determining the outcome
- Looping structures for repeated interactions
This project not only serves as an entertaining game but also as an educational exercise to solidify these basic
programming concepts.
1.3.1Scope
The scope of this Rock, Paper, Scissors program includes:
1. User Interaction: Prompting the user to input their choice (Rock, Paper, or Scissors) and providing feedback
based on the computer's random choice.
2. Random Choice Generation: Using Python's random module to simulate the computer's choice, ensuring an
unpredictable and fair game.
3. Game Logic Implementation: Applying the rules of Rock, Paper, Scissors to determine the winner of each
round.
4. Replayability: Allowing the user to play multiple rounds in a single session and providing an option to exit the
game.
5. User-Friendly Output: Displaying clear and concise messages about the choices made and the result of each
round.
Page 2|9
ROCK, PAPER AND SCISSORS 2023-24
1.3.2 Limitations
The limitations of this project include:
1. Simplicity: The program is designed to be straightforward and may not include advanced features such as a
graphical user interface (GUI) or multiplayer capabilities.
2. Input Validation: While basic input validation is implemented, it might not handle all possible incorrect inputs
gracefully.
3. Statelessness: The program does not maintain state across sessions, meaning it does not keep track of scores or
history once the program is closed.
4. Limited Interactivity: The game is restricted to a single user playing against the computer, without options for
player vs. player or network play.
5. Educational Focus: As an educational tool, the program prioritizes simplicity and clarity over performance
optimizations or complex features.
This section provides a thorough overview of the background, scope, and limitations of the project, giving context to
Page 3|9
ROCK, PAPER AND SCISSORS 2023-24
CHAPTER 2
METHODOLOGY
2.1.2Techniques
1. Input Validation: Ensuring the user inputs a valid choice (i.e., 'Rock', 'Paper', or 'Scissors') and handling invalid
inputs gracefully.
2. Randomization: Using random selection to simulate fair and unpredictable computer choices.
3. Result Determination: Implementing game logic to compare choices and determine the winner.
4. Replayability: Providing a mechanism for the user to play multiple rounds in a single session.
Page 4|9
3
ROCK, PAPER AND SCISSORS 2023-24
4. Command Line/Terminal: Used to run the Python script and interact with the program.
2.2.2Materials
1. Documentation: Python's official documentation and tutorials for understanding syntax and module functionalities.
2. Online Resources: Websites like Stack Overflow, Python community forums, and educational platforms for
troubleshooting and learning best practices.
2.3.2Analysis Procedures
1. Outcome Determination: Analyzing the user's and computer's choices using conditional statements to determine
the winner of each round.
2. Result Tracking: Although the basic version of the program does not store results between sessions, within a
session, results can be tracked to provide feedback after each round.
3. User Feedback: Providing immediate feedback to the user after each round, indicating their choice, the computer's
choice, and the round's outcome.
This section provides a detailed overview of the methods and techniques used in the project, the tools and software
required, and the procedures for data collection and analysis. This information is essential for understanding the
structure and execution of the program.
Page 5|9
ROCK ,PAPER AND SCISSORS 2023-24
Page 6|9
Dept ISE,BGSIT 4
2023-24
3.4PROGRAM:
Page 7|9
Dept of ISE,BGSIT 5
2023-24
CHAPTER 3
RESULT
3.1 OUTPUT:
Here below image shows the various scenarios like where you loose , in which
scenario you win, when there is a tie, and also what message will be displayed when you
enter incorrect input.
Back-End : MySQL
Page 8|9
Dept of ISE,BGSIT 6
ROCK,PAPER AND SCISSORS 2022-23
CONCLUSION
Creating a rock, paper, scissors game in Python demonstrates the language's ease of use and accessibility for
beginners. This project covers fundamental programming concepts such as conditional statements, loops, user
input, and random number generation. Python's straightforward syntax allows developers to focus on learning
these core concepts without being bogged down by complex code. Overall, implementing a rock, paper,
scissors game in Python is an excellent way to introduce essential programming skills in an engaging and
practical manner..
Page 9|9
Dept ISE,BGSIT