Escape Room 3.4 - Welcome
Welcome to the CSP 3.4 Escape Room Challenge - String Operations and Algorithms
- ๐ช Welcome to the CSP 3.4 Escape Room! ๐ช
- ๐ The Digital Escape Challenge ๐
- ๐ The Story
- ๐ฏ Your Mission
- ๐ Rewards
- ๐ Teach First: AP CSP 3.4 โ Strings (Read This Before You Start)
- ๐ง Warm-up Question (Optional Bonus)
- ๐ What to Expect
- ๐ง Skills Youโll Practice:
- ๐ฎ Game Features:
- โฑ๏ธ Time Challenges:
- ๐ Before You Begin:
๐ช Welcome to the CSP 3.4 Escape Room! ๐ช
๐ The Digital Escape Challenge ๐
You find yourself trapped in a digital maze...
Only by mastering String Operations and Algorithms can you escape!
๐ The Story
You are a programmer who has been mysteriously transported into a digital world. The only way out is to solve a series of coding challenges that test your knowledge of:
- String Manipulation ๐ค
- Algorithm Design โ๏ธ
- Problem Solving ๐งฉ
- Code Optimization โก
๐ฏ Your Mission
Navigate through 5 challenging levels, each testing different aspects of CSP 3.4 concepts:
- Level 1: Basic String Operations
- Level 2: String Searching and Patterns
- Level 3: Algorithm Efficiency
- Level 4: Complex String Algorithms
- Level 5: Final Boss Challenge
๐ Rewards
- Bronze Badge: Complete 3 levels
- Silver Badge: Complete 4 levels
- Gold Badge: Complete all 5 levels
- Master Coder: Complete all levels with optimal solutions
๐ Teach First: AP CSP 3.4 โ Strings (Read This Before You Start)
This short article aligns to the AP Computer Science Principles Course and Exam Description (CED), Topic 3.4: Strings. Read it first, then hit Start.
Key ideas (AP pseudocode vs Python)
- A string is a sequence of characters (text).
- AP pseudocode functions you must recognize:
- LENGTH(s) โ number of characters
- CONCAT(a, b) โ join two strings
- subString(s, start, end) โ inclusive, 1-based indices
- Python equivalents (used here only to practice thinking in code):
- len(s), a + b, s[start:end] with 0-based, end-exclusive slices
I Do: Examples (AP Pseudocode)
// Given s โ "COMPUTER SCIENCE"
LENGTH(s) // 17
CONCAT("AP ", "CSP") // "AP CSP"
subString(s, 1, 8) // "COMPUTER"
// Traverse each character
i โ 1
REPEAT UNTIL i > LENGTH(s)
DISPLAY subString(s, i, i)
i โ i + 1
END REPEAT
I Do: Examples (Python)
s = "COMPUTER SCIENCE"
len(s) # 17
"AP " + "CSP" # "AP CSP"
s[0:8] # "COMPUTER" (0-based; end index excluded)
for ch in s:
print(ch)
We Do: Common Patterns (Youโll use these in the levels)
- Prefix / Suffix checks (AP):
- subString(s, 1, LENGTH(t)) = t โ starts with t
- subString(s, LENGTH(s)-LENGTH(t)+1, LENGTH(s)) = t โ ends with t
- Contains a substring (AP):
- Traverse indices i from 1 to LENGTH(s)-LENGTH(t)+1 and compare subString(s, i, i+LENGTH(t)-1) = t
- Build a message:
- CONCAT(โHello, โ, name)
Pitfalls to avoid
- Donโt mix index systems. AP indices start at 1 and subString end is inclusive.
- In Python, slices start at 0 and the end is excluded.
- Focus on the logic; answers on the AP Exam use the AP pseudocode model.
Quick Checks (self-check)
1) What does subString("ALGORITHM", 3, 6) return?
It returns "GORI".2) In AP pseudocode, how do you get the last character of s?
subString(s, LENGTH(s), LENGTH(s))3) True/False: LENGTH("AP CSP") is 5.
True (space counts as a character).Try It (very short warmup)
- Write, in words, how you would check if s starts with โAPโ using AP pseudocode.
- How would you count the number of spaces in s using traversal?
References
- AP CSP CED PDF โ Topic 3.4 Strings (see provided course link)
- AP Daily videos for Topic 3.4 in AP Classroom (watch before you play)
Once youโve read this, click Start to see the Rules and then head to the Levels hub. Good luck! ๐
๐ง Warm-up Question (Optional Bonus)
Before you dive in, answer this quick question for a small bonus:
What Python data type will you be working with throughout this escape room?
๐ What to Expect
๐ง Skills Youโll Practice:
- String concatenation and manipulation
- Substring operations
- Pattern matching and searching
- Algorithm complexity analysis
- Code optimization techniques
๐ฎ Game Features:
- Interactive Challenges: Hands-on coding problems
- Real-time Feedback: Instant validation of your solutions
- Progress Tracking: See your advancement through the levels
- Hints System: Get help when youโre stuck
- Leaderboard: Compete with your classmates
โฑ๏ธ Time Challenges:
- Each level has a recommended completion time
- Bonus points for efficient solutions
- Global timer tracks your total escape time
๐ Before You Begin:
Make sure you're familiar with:
- Basic Python syntax
- String operations in Python
- Function definitions and calls
- Basic algorithm concepts
Ready to test your coding skills? Click the START YOUR ESCAPE button above! ๐ฏ