🎮 Python Mini-Project: Rock–Paper–Scissors

Project Overview

You will build a console-based Rock–Paper–Scissors game in Python. The computer will randomly generate rock, paper, or scissors. The match is Best 3 out of 5 (first to 3 wins) and your program must keep score.

Skills Variables • Input/Output • Random • If/Else • Loops • Validation

✅ Project Specs (Requirements)

Core Features (Required)

  1. The computer randomly chooses: rock, paper, or scissors.
  2. The user types: rock, paper, or scissors each round.
  3. The program prints the user choice and computer choice.
  4. The program determines and prints the winner of the round.
  5. The program keeps score using:
    • player_score
    • computer_score
  6. The match is Best 3 out of 5:
    • First to 3 wins is the match winner.
  7. The program handles invalid input (does not crash; asks again).
  8. The user can type quit to end early.

File Name

Save as: RPS_lastname.py

🧠 Pseudocode (Plan Before You Code)

SET choices to ["rock", "paper", "scissors"]
SET player_score = 0
SET computer_score = 0
SET round_number = 1

DISPLAY game title and instructions

WHILE player_score < 3 AND computer_score < 3:
    DISPLAY round number and current score
    GET player input
    IF player input is "quit":
        DISPLAY quitting message
        END program

    IF player input not in choices:
        DISPLAY invalid input message
        CONTINUE loop

    computer_choice = RANDOM choice from choices
    DISPLAY player choice and computer choice

    IF player choice == computer choice:
        DISPLAY tie message
    ELSE IF player beats computer:
        player_score = player_score + 1
        DISPLAY player wins round
    ELSE:
        computer_score = computer_score + 1
        DISPLAY computer wins round

    round_number = round_number + 1

DISPLAY final score
IF player_score > computer_score:
    DISPLAY player won match
ELSE:
    DISPLAY computer won match
DISPLAY game over

✅ Complete Solution Code (Best 3 out of 5 + Score)

Copy/paste into RPS_lastname.py. This code includes comments, input validation, score tracking, and best 3 out of 5 match rules.

Click here for a video that will discuss this.

📊 Grading Rubric (100 Points)

Category What I’m Looking For Points
Program Runs Code runs without crashing 20
Random Computer Choice Uses random.choice() to select rock/paper/scissors 10
Input & Validation Accepts input and handles invalid choices correctly 15
Correct Game Logic Correctly decides win/lose/tie every round 20
Score Tracking Correctly updates and displays score 15
Best 3 out of 5 Match ends when someone reaches 3 wins 10
Code Quality Good comments, readable variable names, neat formatting 10
Total 100

⭐ Optional Bonus (up to +10)

📥 Turn In all your files: