Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊCreative ChallengesModule 2 Β· πŸ€– AI Pair-Reversed Β· Recapβ€ΊπŸŽ― Review: Creative module 2 recapscenario21 / 104
+80 XP
Task
Build `detective_score(clues_found, clues_total, time_seconds)` β€” a Code Detective scoring helper for the in-game UI: 1. Base score = `int(100 * clues_found / clues_total)` (percent of clues found). 2. `time_seconds <= 30` β†’ bonus +20 (sleuth speed). 3. `30 < time_seconds <= 90` β†’ no bonus. 4. `time_seconds > 90` β†’ penalty -10 (overthinking). 5. Clamp final score to `[0, 100]`. 6. `clues_total == 0` β†’ return 0 (defensive β€” no puzzle to solve).
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
πŸ“Š Result
Press Run to see result...

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…