Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Functions Practice. Collect Pits | Functions
JavaScript Ninja

book
Functions Practice. Collect Pits

Task

Swipe to start coding

Solution

function ninjaController(ninja) {
lootPit(ninja);
ninja.goRight();
ninja.goRight();
lootPit(ninja);
ninja.goRight();
ninja.goRight();
lootPit(ninja);
}

function lootPit(ninja) {
ninja.goDown();
ninja.pickSushi();
ninja.goUp();
}

Explore other courses in Catalog

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 3
ninja.js

ninja.js

function ninjaController(ninja) {
// Write your code below
}

function lootPit(ninja) {
// Write your code below
}

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt