Hi all,
I’m not sure if this is a bug, but I’m hoping so because even google couldn’t help me.
I solved the lost viking level: the hero reached the end of the maze alive. But then he stays there, until the game inform me that I ran out of time. I tried adding a moveXY to the skeleton position, but nothing.
# 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
SWITCH = 5
SKIP = 7
SLIDE = 9
goingSouth = False
sideStepsMade = 1 # total sidesteps
# The maze is 35 steps along the X axis.
while steps <= 35:
self.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
if sideStepsMade % SWITCH == 0:
goingSouth = not goingSouth
# Increment steps and sideSteps as appropriate, taking into account the special rules.
steps += 1
sideStepsMade += 1
# sideSteps amount
if goingSouth == True:
sideSteps -= 1
else:
sideSteps += 1
# wrap around sideSteps
if sideSteps > SLIDE:
sideSteps = 1
elif sideSteps < 1:
sideSteps = SLIDE
# add a side step
if steps % SKIP == 0:
if goingSouth == True:
sideSteps -= 1
else:
sideSteps += 1
Hmm, I tried the code you had, and didn’t make it to the end. I made a couple of changes, to use steps in deciding whether to go north or south. And then moved the step increment to the end of the while block. That then seemed to work ok.
Let me know if I’ve not being very clear - just trying to be helpful without just laying out some code I can always be clearer…
You aren’t supposed to moveXY to the different positions manually; the goal of the level is to create a formula that calculates the next position to which to move. It sounds complicated (and indeed is), but can be solved with perseverance. Good luck!