Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Rock Paper Scissor Game

Description

Classic Rock Paper Scissor game with computer opponent, featuring ASCII art, score tracking, statistics, and engaging gameplay!

Features

  • Play against computer AI
  • Beautiful ASCII art for each choice
  • Score tracking system
  • Win rate calculation
  • Round-by-round results
  • Game statistics
  • Reset functionality
  • Countdown animation
  • Pure Python implementation

Stack

  • Language: Pure Python
  • Libraries: random, time (standard library)
  • Complexity: Beginner

Installation & Usage

No external dependencies required!

python main.py

How to Play

Game Rules

  • 🪨 Rock crushes ✂️ Scissor
  • 📄 Paper covers 🪨 Rock
  • ✂️ Scissor cuts 📄 Paper

Steps

  1. Choose your weapon (Rock/Paper/Scissor)
  2. Computer makes its choice
  3. Winner is determined
  4. Score is updated
  5. Play again or exit

Features Explained

ASCII Art Display

Each choice is displayed with unique ASCII art:

Rock:        Paper:       Scissor:
_______      _______      _______
   ____)        ____)____    ____)____
  (_____)          ______)       ______)
  (_____)         _______)    __________)
  (____)         _______)    (____)
.__(___)    .__________)  .__(___)

Score Tracking

  • Player wins
  • Computer wins
  • Ties
  • Total rounds played

Statistics

  • Win rate percentage
  • Overall winner
  • Performance analysis

Game Controls

  • 1-3: Make your choice
  • 4: View statistics
  • 5: Reset game
  • 6: Exit game

Use Cases

  • Entertainment: Fun quick game
  • Learning: Probability and random choice
  • Decision Making: Random selection tool
  • Breaks: Quick game during study/work
  • Teaching: Intro to programming logic

Learning Outcomes

  • Random number generation
  • Conditional logic
  • Game state management
  • User input validation
  • ASCII art display
  • Score tracking
  • Function design
  • Control flow

Game Strategy

Random Computer

The computer makes completely random choices, so there's no pattern to exploit!

Probability

  • Each choice has 33.33% chance
  • No choice is "better" than others
  • Pure luck-based game

Win Rate

  • 33.33% win
  • 33.33% lose
  • 33.33% tie

Code Structure

get_computer_choice()      # Computer's random choice
determine_winner()         # Compare choices
display_choice()           # Show ASCII art
main()                     # Game loop

Customization

Add More Choices

Extend to "Rock Paper Scissor Lizard Spock":

choices = ['rock', 'paper', 'scissor', 'lizard', 'spock']

Difficulty Levels

# Easy: Computer makes more mistakes
# Hard: Computer uses pattern recognition

Sound Effects

Add sound effects for each choice and result

Fun Facts

Origin

  • Dates back to Han Dynasty (206 BCE – 220 CE)
  • Called "Jan-ken" in Japan
  • Global phenomenon

Variations

  • Rock Paper Scissor Lizard Spock (Big Bang Theory)
  • Rock Paper Scissor Fire Water
  • Many cultural variations

Competitive Play

  • World RPS Society exists
  • International tournaments
  • Strategy guides available

Tips

  • No strategy works (it's random!)
  • Play for fun, not wins
  • Track statistics over many rounds
  • Challenge friends to beat your win rate

Future Enhancements

  • Best of 3/5/7 rounds
  • Multiplayer mode (2 players)
  • AI with patterns
  • Tournament bracket
  • Leaderboard
  • Save statistics to file
  • Custom rules
  • Sound effects
  • GUI version
  • Online multiplayer
  • Achievement system

Game Variations

Best of Series

Play best of 3, 5, or 7 rounds

Timed Rounds

Limited time to make choice

Elimination Tournament

Multiple players compete

Real-World Applications

  • Decision Making: Choose between 3 options randomly
  • Conflict Resolution: Fair way to decide
  • Game Theory: Study random choice strategies
  • Teaching Tool: Programming logic
  • Icebreaker: Fun activity with others

Educational Value

Programming Concepts

  • Random number generation
  • Conditional statements
  • Loops
  • Functions
  • User input
  • String formatting

Math Concepts

  • Probability (1/3 for each)
  • Statistics (win rate)
  • Counting (score tracking)

License

Open source for educational purposes.