A step-by-step set of instructions to solve a problem
Flowchart
A visual diagram that shows the steps of an algorithm using symbols
Pseudocode
Code-like writing that plans logic before actual programming
Iteration
Repeating steps using loops (while, for)
Selection
Making choices using if statements
Sequencing
Executing steps in order, one after another
📅 Day 1: Introduction to Algorithms & Flowcharts
Time: 50 minutes
🎯 Today's Objective
Students will apply flowchart design principles to visualize a Python Karel algorithm using proper symbols and sequence.
🔥 Warm-Up (5 minutes)
Question: "What is an algorithm? Give one real-life example from your daily routine."
Examples: Making breakfast, getting ready for school, playing a video game level
📚 Part 1: What is an Algorithm? (10 minutes)
Definition
Algorithm: A step-by-step set of instructions to solve a problem.
Real-World Examples:
🥪 Recipe for making a sandwich
🚗 Directions to get to school
🎮 Steps to complete a game level
📱 Process to post on social media
Three Building Blocks of ALL Algorithms:
Sequencing - Steps in order
Iteration - Repeating steps (loops)
Selection - Making choices (if statements)
🎨 Part 2: Flowchart Symbols (10 minutes)
⭕
Start/End
Oval shape marks beginning or end
⬜
Process
Rectangle for actions like "move()"
🔷
Decision
Diamond for yes/no questions
➡️
Arrow
Shows flow direction
Key Rules: Always start with "Start" and end with "End". Decisions have two paths (Yes/No). Arrows show the order. Loops connect back to earlier steps.
👨🏫 Part 3: Teacher-Led Flowchart Example (15 minutes)
Problem: Karel moves forward until hitting a wall
⭕ Start
↓
🔷 Is front clear?
↙ Yes No ↘
⬜ move() ⭕ End
↓ (loop back)
Karel Python - CodeHS Editor
1 2 3
defmove_to_wall():
while front_is_clear():
move()
✏️ Guided Practice (10 minutes)
Practice Problem: Karel picks up a ball if one is present
Your Task:
Write the algorithm in plain English
Identify the decision point
Draw the flowchart with proper symbols
⭕ Start
↓
🔷 Is ball present?
↙ Yes No ↘
⬜ take_ball() (skip)
↓ ↓
⭕ End ← ← ← ← ←
🤔 Reflection Question
"Why is visualizing an algorithm with a flowchart helpful before coding?"
🏠 Homework
Draw a simple flowchart for one of these:
Karel moves forward 3 times
Karel turns right (using turn_left() three times)
📅 Day 2: Partner Flowcharts & Pseudocode
Time: 50 minutes
🎯 Today's Objective
Students will create a flowchart with a partner for a Python Karel algorithm and translate it into pseudocode.
🔥 Warm-Up (5 minutes)
Quick Quiz: Which control structure should Karel use to move forward until a ball is present?
A) for loop
B) while loop ✅
C) if statement
D) if/else statement
📺 Part 1: Move Stack Algorithm (10 minutes)
Problem: Move a pile of tennis balls one space east
Algorithm Steps:
Move to the pile
While balls are present:
Pick up one ball
Move forward
Put down the ball
Come back
End
Karel Python - CodeHS Editor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# Main algorithmdefmove_pile():
while balls_present():
move_single_ball()
# Helper functiondefmove_single_ball():
take_ball()
move()
put_ball()
come_back()
# Come back functiondefcome_back():
turn_around()
move()
turn_around()
👥 Part 2: Partner Activity (20 minutes)
Work with your partner to:
1Write the algorithm in plain English (3 min)
2Identify all decisions and loops (2 min)
3Draw the complete flowchart together (10 min)
4Translate to pseudocode (5 min)
Main Algorithm Flowchart:
⭕ Start
↓
⬜ Move to pile
↓
🔷 Are balls present?
↙ Yes No ↘
⬜ move_single_ball() ⭕ End
↓ (loop back)
Sub-Algorithm: Move Single Ball
⭕ Start
↓
⬜ take_ball()
↓
⬜ move()
↓
⬜ put_ball()
↓
⬜ come_back()
↓
⭕ End
🤔 Reflection Questions
"How does breaking a problem into sub-algorithms make coding easier?"
"Where do decisions appear in your flowchart?"
"How did you show the loop in your flowchart?"
🎤 Partner Share-Out (5 minutes)
Selected pairs present:
One key decision in their flowchart
How they handled the loop
Where they used helper functions
🏠 Homework
Write pseudocode for this problem: "Karel moves to a wall, turns left, and moves forward twice."
📅 Day 3: Independent Project - Decorate the Wall
Time: 50 minutes
🎯 Today's Objective
Students will apply their algorithmic thinking skills to create a complete flowchart, pseudocode, and Python solution for the "Decorate the Halloween Wall" challenge.
🔥 Warm-Up (5 minutes)
Reflection: "What is the main advantage of writing pseudocode before writing actual Python code?"
Write 2-3 sentences and share with a neighbor.
🎃 Major Assignment: Decorate the Halloween Wall
The Problem:
Karel is preparing for Halloween by hanging jack-o-lantern lights along a wall. Karel must place lights (balls) only where there is a wall, avoiding doors and windows!
Requirements:
✅ Karel starts in bottom-left corner facing East
✅ Karel ends at top of wall facing North
✅ Place a ball ONLY where right_is_blocked() is True
✅ World height: 10 rows
✅ Include comments for ALL functions
📝 Step-by-Step Process (30 minutes)
1Understand the Problem (5 min)
Answer these questions:
Where does Karel start? (Bottom-left, facing East)
Where should Karel end? (Top of wall, facing North)
When should Karel put a ball? (When right_is_blocked())
When should Karel NOT put a ball? (Doors/windows = right is clear)
2Plan Algorithm in Plain English (5 min)
Move to the wall (go_to_wall)
Turn left to face the wall
While the front is clear:
If right is blocked → put ball
Move forward
Check one last time: if right is blocked → put ball
3Create Your Flowchart (10 min)
Draw a complete flowchart using proper symbols:
⭕ Start/End ovals
⬜ Process rectangles for actions
🔷 Decision diamonds for conditionals
➡️ Arrows showing flow and loops
Decorate Wall Flowchart:
⭕ Start
↓
⬜ go_to_wall()
↓
⬜ turn_left()
↓
🔷 Is front clear?
↙ Yes No ↘
🔷 Right blocked? ⭕ End
↙ Yes No ↘
⬜ put_ball() (skip)
↓ ↓
⬜ move() ← ←
↓ (back to "Is front clear?")
4Translate to Pseudocode (5 min)
Karel Python - CodeHS Editor
1 2 3 4 5 6 7 8 9 10 11 12
# Function to move to wall
function go_to_wall():
while front_is_clear():
move()
# Function to decorate wall
function decorate_wall():
while front_is_clear():
if right_is_blocked():
put_ball()
move()
if right_is_blocked():
put_ball()
# Main program
go_to_wall()
turn_left()
decorate_wall()
5Implement Python Code
Karel Python - CodeHS Editor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# Go until Karel hits a walldefgo_to_wall():
while front_is_clear():
move()
# Move along the wall# Put a ball where there isn't a door or gatedefdecorate_wall():
while front_is_clear():
if right_is_blocked():
put_ball()
move()
if right_is_blocked():
put_ball()
# Main execution
go_to_wall()
turn_left()
decorate_wall()
Testing Tips: Run your program in CodeHS. Check Karel's final position. Verify balls are only where walls exist. Test with different world configurations!
🤔 Reflection Questions
"How did you decide where to put the decision diamond in your flowchart?"
"What part of your algorithm could be reused in other Karel problems?"
"Why is it important to test each function individually before combining them?"
"What was the hardest part of translating your flowchart into code?"
📤 Submission Requirements
✅ Flowchart (hand-drawn or digital)
✅ Pseudocode
✅ Python code with comments
✅ Reflection responses
🌟 Extension Challenge (Optional)
Create Your Own Algorithm Challenge!
Design a new Karel problem that includes:
At least one loop
At least one decision
A clear start and end state
Create the flowchart first, then implement it in Python!