I cant see what s wrong with my code in don't rush stay quiet

This 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 (0 <= n < 30)

def mod30(n):
if n >= 30:
return n - 30
else:
return n

This function should return a value from 0 to 40 (0 <= n < 40)

def mod40(n):
# Use an if-statement to return the correct value.
if 0 <= n < 40:
return n

You don’t need to change the following code:

while True:
time = hero.time
x = mod30(time) + 25
y = mod40(time) + 10
hero.moveXY(x, y)

please format your code with the </> button

So look at the mod30(n) function. You need to do exactly that for the mod40(n) function, except you need to replace the number 30 with the number 40.

look at

and

think about it. Your just cheking the same thing but with a grader number.Its basically the same function

1 Like

Altough if you do need more help check this topic :

Don’t rush be quiet I Need Help

Level Help

Jul '19 - I’ll direct you to another post that is having the same issue. Don't Rush Be Quiet Don’t Rush Be Quiet Hi @Xuan . I think you might be overthinking this level. The mod40() function should be exactly the same as the mod30 function but with 40 instead of 30…

Thanks! the code works!

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.