Computer Science PACK-CSP-1 · WS-CSP-1-02
Debugging and Patterns
Computational Thinking Foundations — Finding bugs and recognizing patterns
๐Ÿ“ Directions: Find the bugs in algorithms, complete patterns, and practice IF-THEN thinking!
Part A: Find the Bug!

A bug is a mistake in your algorithm. Debugging means finding and fixing it!

Getting Ready for School

1. Wake up โ†’ 2. Put on shoes โ†’ 3. Get dressed โ†’ 4. Eat breakfast โ†’ 5. Walk to school

๐Ÿ› Which step is in the wrong place? ___ The correct order is:

Planting a Seed

1. Dig a hole โ†’ 2. Water the plant โ†’ 3. Put the seed in โ†’ 4. Cover with dirt โ†’ 5. Wait for it to grow

๐Ÿ› Which step should come after covering with dirt? ___ The correct order is:

Washing Your Hands

1. Turn on water โ†’ 2. Dry your hands โ†’ 3. Add soap โ†’ 4. Scrub for 20 seconds โ†’ 5. Rinse

๐Ÿ› Which step is in the wrong place? ___ The correct order is:

Part B: Pattern Power!

Computers are great at patterns! What comes next?

  1. ๐Ÿ”ด ๐Ÿ”ต ๐Ÿ”ด ๐Ÿ”ต ๐Ÿ”ด ___ ___
  2. โฌ†๏ธ โฌ†๏ธ โžก๏ธ โฌ†๏ธ โฌ†๏ธ โžก๏ธ ___ ___ ___
  3. 1, 2, 3, 1, 2, 3, ___, ___, ___
  4. ๐Ÿ‘ ๐Ÿ‘ ๐Ÿฆถ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿฆถ ___ ___ ___
  5. AB AB AB ___ ___
Part C: If-Then Thinking

Computers use IF-THEN rules. Finish each one:

IF it is raining THEN I will _______________

IF I am hungry THEN I will _______________

IF my friend is sad THEN I will _______________

IF _______________ THEN _______________ (write your own!)