In the level Lost Viking, even though i used the hints and did exactly what they said, my hero always mess up around step 32, and the land mines trigger.
Is this a bug or a code error?
Here’s my code:
Code
# You MUST click on the HELP button to see a detailed description of this level!
# The raven will tell you what to use for your maze parameters!
# How many sideSteps north of the Red X you've taken.
sideSteps = 1
# How many steps east of the Red X you've taken.
steps = 1
# Multiply this with steps to determine your X coordinate. DON'T CHANGE THIS!
X_PACE_LENGTH = 4
# Multiply this with sideSteps to determine your Y coordinate. DON'T CHANGE THIS!
Y_PACE_LENGTH = 6
slide = 10
switch = 7
skip = 11
to_skip = False
switches = 0
# The maze is 35 steps along the X axis.
while steps < 35:
# Take the next step:
if steps % skip == 0 and steps != 0:
to_skip = True
if steps % switch == 0 and steps != 0:
switches += 1
if sideSteps > slide:
sideSteps = 1
if sideSteps < 1:
sideSteps = slide
if to_skip:
if switch % 2 == 0:
hero.moveXY(steps * X_PACE_LENGTH, (sideSteps + 1)* Y_PACE_LENGTH)
to_skip = False
steps += 1
sideSteps += 2
if switch % 2 == 1:
hero.moveXY(steps * X_PACE_LENGTH, (sideSteps + 1)* Y_PACE_LENGTH)
to_skip = False
steps += 1
sideSteps -= 2
if switches % 2 == 0:
hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
steps += 1
sideSteps +=1
if switches % 2 == 1:
hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
steps += 1
sideSteps -=1
# Increment steps and sideSteps as appropriate, taking into account the special rules
Is something wrong here…
Screenshot of failure: