[Solved] Don´t Rush, Be Quiet - [Python Help]

My Hero is Running slowly but at the end he runs a short time to fast and every Cannon is shooting him away. I dont know how to solve that Problem :confused:
This is my Code:

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

def mod40(n):
    if n >= 40:
        return n
        return n

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

Can you send me a link to this level?

1 Like

Hi @paddok, you haven’t quite formatted your code right.
Please put three ``` on two lines on your post, the make a line inbetween them and paste in your code directly from codecombat.

1 Like

Now i did. Now i understand that system. Back to my Question please :smiley:

Here it is: https://codecombat.com/play/level/dont-rush-be-quiet?

Here you have to write like in last def:

if n >= 40:
        return n - 40

The def mod30(n) is fine, but for the def mod40(n) just copy and paste the mod30(n) to where the mod40(n) should be and change all of the 30 to 40 in def mod40(n)


Thank you for helping me out :blush:
It works. What 3 letters and Numbers can make xD

1 Like

Congratulations! :partying_face:

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