Rock Paper Scissors Challenge Worksheet
Computing Foundations • 90-Min Block Project
Rock, Paper, Scissors: Conditional Logic Challenge
Formative Assessment & Google Colab Programming Project
Name:
Period:
Date:
Learning Target
I can use comparisons and conditional statements to make a Python program decide between different outcomes.
New Tool: Random Selection
import random
computer = random.choice(["rock", "paper", "scissors"])
Syntax Note: random.choice() allows Python to automatically pick one random option from the provided choices. (You do not need to study lists right now—simply use this exact command to let the computer make a blind move!)
1
Section 1: Plan the Game Algorithm
Prompt: What does the program need to do from beginning to end? Write out the sequential steps in plain English before writing any Python code:
Core Game Rules: Complete the Relationships
• Rock beats
• Paper beats
• Scissors beats
• A tie happens when
Why does a computer need these rules written clearly and explicitly before it can determine a winner?
Computing Foundations • Conditional Logic Programming Challenge Page 1 of 6
Student Worksheet • Module 4: Selection & Conditionals Google Colab Project
2
Section 2: Variables and Input Setup
Player choice:
Computer choice:
Input & Setup Requirements:
Create player choice variable
Create computer choice variable
Use input() for user move
Use random.choice() for computer move
Display both choices to the screen using print()
Optional: Formatted Strings (f-strings) Not required for project
name = "Alex"; print(f"Hello, {name}!")
An f-string allows variables to be inserted directly into text inside { }.
3
Section 3: Understanding the Tie Condition
1. What must be true about the two variables for the game to end in a tie?
2. Which comparison operator checks if choices are equal?
3. In your own words, explain what your tie-checking if statement checks during execution:
4
Section 4: Building the Winning Conditions (Planning Matrix)
Complete the table below to plan every non-tie outcome before programming in Colab:
| Player Chooses | Computer Chooses | Result (Win/Loss) | Condition Needed (Comparison Expression) |
|---|
| "rock" | | | |
| "rock" | | | |
| "paper" | | | |
| "paper" | | | |
| "scissors" | | | |
| "scissors" | | | |
💡 Architecture Note: You may use nested conditionals (e.g., check player choice first, then test computer choice inside) or compound conditions approved by your teacher.
Computing Foundations • Conditional Logic Programming Challenge Page 2 of 6
Student Worksheet • Module 4: Selection & Conditionals Google Colab Project
5
Section 5: Understanding Nested Conditionals
weather = "rainy"
if weather == "rainy":
temperature = 45
if temperature < 50:
print("Bring a coat.")
1. What does the outer if check?
2. What does the inner if check?
3. When will "Bring a coat." print?
4. Why might a programmer place one if inside another?
6
Section 6: Build the Game Programming Checklist
Open your notebook in Google Colab. Check off each requirement as you code and test:
Import random
Correctly identify rock beats scissors
Random choice for computer
Correctly identify paper beats rock
Ask player choice with input()
Correctly identify scissors beat paper
Display computer's choice
Correctly identify computer wins
Correctly identify a tie
Use if, elif, else properly
Use correct indentation
Runs completely without errors
7
Section 7: Explain Your Conditionals (Formative Assessment Core)
Answer in complete sentences to demonstrate your conceptual reasoning:
1. What does your first if check?
2. Why check for a tie before/separately?
3. What does elif allow your program to do?
4. What role does else play in your code?
5. Why does the order of your conditional statements matter to Python?
6. What would happen if every condition were written as a separate if statement instead of using elif and else?
Computing Foundations • Conditional Logic Programming Challenge Page 3 of 6
Student Worksheet • Module 4: Selection & Conditionals Google Colab Project
8
Section 8: Trace the Program Execution
Trace how Python evaluates each test scenario based on your conditional logic:
Scenario 1:
Player = "rock"
Computer = "rock"
Which condition is True first?
What will the program print?
Scenario 2:
Player = "paper"
Computer = "rock"
Which branch should run?
Why does this branch trigger?
Scenario 3:
Player = "scissors"
Computer = "rock"
Which condition(s) are False?
Which part handles this result?
9
Section 9: Empirical Testing & Controlled Debugging
Testing Strategy Tip: Because the computer chooses randomly, you can temporarily override the computer move with a fixed value like computer = "scissors" to verify your logic, then restore random.choice(...)!
| Outcome | Player Choice | Computer Choice | Expected Result | Actual Result | Did It Work? |
|---|
| Tie Outcome | | | | | ☐ Yes ☐ No |
| Player Win | | | | | ☐ Yes ☐ No |
| Computer Win | | | | | ☐ Yes ☐ No |
Why is testing with controlled, fixed values useful when debugging a program?
10
Section 10: Debugging Reflection Log
1. What specific error or unexpected behavior did you encounter while building your code?
2. What caused this issue to happen?
3. How did you resolve or fix it?
4. Was the issue a syntax error, a logic error, or something else? Explain your reasoning:
Computing Foundations • Conditional Logic Programming Challenge Page 4 of 6
Student Worksheet • Module 4: Selection & Conditionals Google Colab Project
11
Section 11: Extension Challenges (OPTIONAL)
Choose 1 or more to explore
Finished your core program early? Push your programming skills further with these optional challenge features.
Extension 1: Case Sensitivity Handling with .lower()
Strings
Standardize inputs like "Rock", "ROCK", or "rock":
player = input("Choose rock, paper, or scissors: ").lower()
What specifically does .lower() change about the input string?
Extension 2: Detecting Invalid User Input
Input Validation
Add conditional validation logic that detects when a player types an invalid word (e.g., "banana") and displays an error message.
Where in your conditional structure should this validation check take place, and why?
Extension 3: Descriptive Battle Feedback
User Experience
Instead of just printing "You win!", explain why (e.g., "Rock smashes scissors!", "Paper covers rock!").
Write out one custom descriptive message you programmed into your game:
Extension 4: Score Tracking Variables
State Variables
Initialize player_score = 0 and computer_score = 0 and increment the winner's score by 1.
What problem remains with keeping score if the game script only runs once per execution?
Extension 5: Sneak Peek Preview of Loops
Advanced Preview
Loops have not been formally taught yet, but Python has a statement that repeats indented code 3 times:
for i in range(3):
# Indent your entire game code here to play 3 rounds!
What would happen to your indentation level if you wrapped your game logic inside this loop?
Computing Foundations • Conditional Logic Programming Challenge Page 5 of 6
Student Worksheet • Module 4: Selection & Conditionals Google Colab Project
12
Section 12: Final Conceptual Reflection
1. How did this program use the algorithmic concept of selection from our Algorithmic Thinking unit?
2. How did if, elif, and else allow the computer to make a logical decision?
3. Which part of the program required the greatest amount of logical reasoning to design? Why?
4. If you wanted the game to keep running continuously until the player decides to type "quit", what new programming capability would Python need?
5. Self-Assessment: Rate your confidence with conditional logic (Circle one):
1 Still confused
2 Understand some
3 Can trace code
4 Can write with help
5 Independently build
Final Project Submission Checklist
Confirm that all required components are completed before turning in:
Program runs without error in Colab
Completed conditional explanations (Sec 7)
Correctly identifies wins, losses, & ties
Completed reflection & confidence rating
Tested multiple outcomes in Section 9
Submitted / shared Google Colab notebook
Completed and turned in this physical worksheet
Teacher Check / Score: _______ / 25 pts
Instructor Signature:
Computing Foundations • Conditional Logic Programming Challenge Page 6 of 6