Course Content
Ninja Game
Ninja Game
Challenge: Build letter E
Welcome to the "Build Letter E" challenge!
Let's recap the ninja methods and features you've learned:
Ninja Methods:
goRight()
,goLeft()
,goUp()
,goDown()
: Move the ninja one cell in the specified direction.pickSushi()
: Pick up sushi from the map and add it to your inventory.putSushi()
: Place sushi from your inventory onto a cell.objectUp()
,objectDown()
,objectRight()
,objectLeft()
: 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.
Task
Swipe to show code editor
Goal: Build the letter "E" using sushi on the grid.
Use any of the ninja methods and programming concepts you've learned to complete this task.
Solution
Starter Map
Goal Map
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 2
ninja.js
index.html
preset.js
Challenge: Build letter E
Welcome to the "Build Letter E" challenge!
Let's recap the ninja methods and features you've learned:
Ninja Methods:
goRight()
,goLeft()
,goUp()
,goDown()
: Move the ninja one cell in the specified direction.pickSushi()
: Pick up sushi from the map and add it to your inventory.putSushi()
: Place sushi from your inventory onto a cell.objectUp()
,objectDown()
,objectRight()
,objectLeft()
: 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.
Task
Swipe to show code editor
Goal: Build the letter "E" using sushi on the grid.
Use any of the ninja methods and programming concepts you've learned to complete this task.
Solution
Starter Map
Goal Map
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 2
Switch to desktop for real-world practiceContinue from where you are using one of the options below