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

abc
December 18, 2020, 4:23pm
#3
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

phantomofthedark2:

if n >= 30:

and

phantomofthedark2:

if 0 <= n < 40:

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…

system
closed
December 22, 2020, 11:26am
#7
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.