Challenge: Build letter K
Welcome to the "Build Letter K" challenge! In this chapter, you'll put your programming skills to the test by constructing the letter "K" using the Ninja Game.
Before you begin, let's quickly recap the ninja methods and features you've learned:
Ninja Methods:
go_right()
,go_left()
,go_up()
,go_down()
: Move the ninja one cell in the specified direction.pick_sushi()
: Pick up sushi from the map and add it to your inventory.put_sushi()
: Place sushi from your inventory onto a cell.object_up()
,object_down()
,object_right()
,object_left()
: Determine the object in the next cell in the specified direction, returning "wall", "sushi", or "empty".
Programming Concepts:
- Functions: Create reusable blocks of code to perform specific tasks.
- Decomposition: Break down complex problems into smaller, manageable parts.
- Loops: Use
for
andwhile
loops to repeat actions. - Conditional Statements: Use
if-else
statements to make decisions based on conditions.
Swipe to start coding
Solution
Explore other courses in Catalog
Thanks for your feedback!
ninja.py
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Can you give me an example of how to use these ninja methods?
What does the map look like for the "Build Letter K" challenge?
Can you explain how to start building the letter "K" with these methods?
Awesome!
Completion rate improved to 2.94
Challenge: Build letter K
Swipe to show menu
Welcome to the "Build Letter K" challenge! In this chapter, you'll put your programming skills to the test by constructing the letter "K" using the Ninja Game.
Before you begin, let's quickly recap the ninja methods and features you've learned:
Ninja Methods:
go_right()
,go_left()
,go_up()
,go_down()
: Move the ninja one cell in the specified direction.pick_sushi()
: Pick up sushi from the map and add it to your inventory.put_sushi()
: Place sushi from your inventory onto a cell.object_up()
,object_down()
,object_right()
,object_left()
: Determine the object in the next cell in the specified direction, returning "wall", "sushi", or "empty".
Programming Concepts:
- Functions: Create reusable blocks of code to perform specific tasks.
- Decomposition: Break down complex problems into smaller, manageable parts.
- Loops: Use
for
andwhile
loops to repeat actions. - Conditional Statements: Use
if-else
statements to make decisions based on conditions.
Swipe to start coding
Solution
Explore other courses in Catalog
Thanks for your feedback!
Awesome!
Completion rate improved to 2.94ninja.py