Please learn to post your code correctly. The way it is now, we can’t see the structure. Help us help you. It’s very easy to do and just takes a tiny bit of effort. Please read this topic and format your code again correctly
# 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)
if n >= 30:
return n - 30
# This function should return a value from 0 to 40 (0 <= n < 40)
# Use an if-statement to return the correct value.
if n >= 40:
return n - 40
# You don't need to change the following code:
time = hero.time
x = mod30(time) + 25
y = mod40(time) + 10