= Lesson 4: Speed Measurements
:lesson-id: cuttle-red-04
:agent: Red
:stage: Cuttle
:difficulty: Beginner
:duration: 25 minutes
:hidden-concept: Algorithmic complexity and efficiency measurement

== How Fast Is Fast?

**Speedy Red says:** "Today we're going to MEASURE speed! Not just 'fast' or 'slow' - but EXACTLY how fast!"

== What You'll Learn

* How to count steps
* How to compare different paths
* Why counting steps matters

== Measuring Speed

=== Activity 1: Counting Steps

Let's count how many moves it takes to reach the finish!

Path A:
----
START → → → FINISH
        1   2   3
----
**3 steps!**

Path B:
----
START → → → → → FINISH
        1   2   3   4   5
----
**5 steps!**

[quiz]
--
question: Which path takes fewer steps?
options:
  - Path A (3 steps)
  - Path B (5 steps)
correct: Path A (3 steps)
feedback: "Speedy Red says: 'Fewer steps = faster finish!'"
--

=== Activity 2: The Step Counter Race

Race through the course. Watch the step counter!

[game]
--
type: step-counter-race
track: branching-paths
character: speedy-red
display: step-count
goal: minimize-steps
--

**Speedy Red says:** "See that number? That's how many steps you took! Can you do it in fewer?"

=== Activity 3: Compare the Paths

Here are two paths to the same finish. Count the steps for each!

[interactive]
--
type: path-comparison
path-a:
  visual: "START→→→↓→→FINISH"
  steps: 6
path-b:
  visual: "START↓↓→→→→→FINISH"
  steps: 8
question: "Which path is more efficient?"
--

=== Activity 4: Big Numbers, Small Numbers

Sometimes paths seem the same length... but they're not!

[table]
|===
|Track |Path A Steps |Path B Steps |Winner

|Small Track |5 |7 |Path A
|Medium Track |10 |15 |Path A
|Big Track |20 |35 |Path A
|===

**Speedy Red says:** "Notice something? Path A is ALWAYS better! Even when the track gets bigger!"

=== Activity 5: The Growing Track Challenge

Watch what happens as the track gets bigger!

[game]
--
type: scaling-comparison
sizes: [small, medium, large, huge]
compare:
  - name: "Straight Path"
    growth: linear
  - name: "Zigzag Path"
    growth: quadratic
display: step-graph
--

**Speedy Red says:** "See how the zigzag path gets WAY worse on big tracks? Some approaches don't SCALE!"

== What You Learned (Ultra Secret!)

You discovered:

* **Counting operations:** Steps = work the computer does
* **Comparing efficiency:** Fewer steps = better algorithm
* **Scaling:** Some solutions get worse much faster than others

**Computer scientists call this "algorithmic complexity" - measuring how much work a solution takes!**

== Challenge: Find the Fastest Path

Given this track, find the path with the FEWEST steps:

[puzzle]
--
type: pathfinding
grid-size: 5x5
start: [0, 0]
finish: [4, 4]
obstacles: [[1,1], [2,2], [3,1]]
goal: minimize-steps
--

== Next Time

In Lesson 5, we'll learn about RULES - what you're allowed to do and what you're not!

**Speedy Red says:** "Now you're thinking like a real efficiency expert! Counting steps is the secret to going fast!"
