Lesson 04

Computational
Thinking.

Computational thinking is a problem-solving framework that lets us tackle complex challenges the way computers do — by breaking them apart, spotting patterns, and designing step-by-step solutions.

🔍
Decomposition

Breaking a complex problem into smaller, manageable sub-problems that are easier to understand and solve individually.

🔎
Pattern Recognition

Identifying similarities, trends, and regularities within and across problems to make solving them faster and more efficient.

🧩
Abstraction

Focusing only on the essential information needed to solve a problem, filtering out irrelevant details and complexity.

📋
Algorithm Design

Creating a clear, ordered sequence of steps or rules that produce a correct solution and can be repeated reliably.

How CT applies to Rock Paper Scissors

Every pillar of computational thinking shows up in this simple game.

CT PillarIn Rock Paper Scissors
Decomposition Split the game into parts: get player input → generate computer choice → compare choices → determine winner → update score → repeat.
Pattern RecognitionWin/loss logic follows a repeating pattern: each choice beats one and loses to one. We encode this as a single rule set reused every round.
Abstraction We don't need real hands or physics — just three strings and a comparison function. Everything else is irrelevant.
Algorithm Design A clear sequence: (1) Player picks, (2) Computer picks randomly, (3) Compare using the rule table, (4) Award point, (5) Display result.

Activity — Play the Game

Best of 3 — first to 2 wins the match.

Rock · Paper · Scissors
Best of 3 — first to 2 wins
0 You
0 Draws
0 Computer
You
VS
Computer
Choose your move to begin!