Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Functions Practice | Functions
Ninja Game
course content

Course Content

Ninja Game

Ninja Game

1. Basic Controls
2. Functions
3. Loops
4. If-Else Statements
5. Challenges

book
Functions Practice

In this chapter, you'll have the opportunity to practice writing functions in JavaScript. Functions are a fundamental part of programming that allow you to encapsulate a set of instructions and reuse them throughout your code. By practicing writing functions, you'll become more comfortable with structuring your code in a way that is both efficient and easy to understand.

In the previous chapter, you learned how to define and call functions. Now, it's time to put that knowledge into practice.

Task
test

Swipe to show code editor

Goal: Collect all sushi.

Use the function lootDiagonal(ninja) to navigate and collect sushi.

Solution

Starter Map

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 2
js

ninja.js

html

index.html

js

preset.js

toggle bottom row

book
Functions Practice

In this chapter, you'll have the opportunity to practice writing functions in JavaScript. Functions are a fundamental part of programming that allow you to encapsulate a set of instructions and reuse them throughout your code. By practicing writing functions, you'll become more comfortable with structuring your code in a way that is both efficient and easy to understand.

In the previous chapter, you learned how to define and call functions. Now, it's time to put that knowledge into practice.

Task
test

Swipe to show code editor

Goal: Collect all sushi.

Use the function lootDiagonal(ninja) to navigate and collect sushi.

Solution

Starter Map

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 2
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt