Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Help with the level "Don't rush, Be Quiet"{SOLVED}

#1

Here is my code.

// Dodge the cannons and collect 8 gems.
// Watch out, cannons are ready to fire!
// Move slow along a special pattern to confuse them.

// This function returns a value from 0 to 30:
function mod30(n) {
    if (n >= 30) {
        return n - 30;
    } else {
        return n;
    }
}

// This function should return a value from 0 to 40:
function mod40(n) {
    // Use an if-statement to return the correct value.
    if (n >= 40) {
        n = n- 40;
        return n;
    } else {
        return n;
    }
}

// You don't need to change the following code:
while (true) {
    var time = hero.now();
    var x = mod30(time) + 25;
    var y = mod40(time) + 10;
    hero.moveXY(x, y);
}

Also, for some reason,

…That happens.

#2

I can’t find anything wrong. Maybe your should change your equipments?
may you show me your equipments?

#3

I have a friend who is stuck on this level with the same code as this.

#4

What gear do they have equipped?

#5

Nevermind he got it fixed but I got stuck on the level Mountain Mercenaries. In Cloudrip Mountain.

#6

I don’t know what I’m doing wrong. I have the fastest boots.


Sorry for the Necro

#7

Look closely at the comment instructions in line 12. Then compare to what you have for code in that function.

1 Like
#8

Mod edit: Please do not request solutions. The purpose of this board is to assist people with their code. Simply providing solutions is counter productive to the learning process. There are many people here willing and able to assist you with your code but we do not just give the answers. Thanks.