SectionΒ 3. ChapterΒ 2
ninja.py
Zigzag Path
Swipe to show menu
When solving Ninja game tasks, do not start by writing every command one by one.
Instead, look for patterns:
- Does the Ninja repeat the same sequence of actions?
- Do similar movements and pickups appear in multiple places?
If so, that repeated sequence is a good candidate for a function.
Check loot_zig_zag(ninja)

If you want to get a hint about how the custom loot_zig_zag function may work, click the button above.
Task
Swipe to start coding
Solution
Explore other courses in Catalog
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 2
ninja.py
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat