# Lost Viking Code Help

I’m having trouble with the Lost Viking level. Here’s my current code (Python):

``````SLIDE = 8
SWITCH = 6
SKIP = 11

steps = 1
sideSteps = 1
X_PACE_LENGTH = 4
Y_PACE_LENGTH = 6
s=1

while steps <= 35:
self.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
if steps % SWITCH == 0:
s = -s
if steps % SKIP == 0:
sideSteps += s
sideSteps += s
if sideSteps < 1:
sideSteps = SLIDE
if sideSteps > SLIDE:
sideSteps = 1
steps += 1
``````

It works just fine for a while, but my character runs into a land mine after about 17 seconds:

Can someone help me debug my code? Thanks in advance!

This particular seed is an interesting one. Because of its boundaries, when `sideSteps < 1`, you have to set `sideSteps` to `SLIDE - 1` instead of `SLIDE`. That’s your problem.

1 Like

Thanks! My code works now and I have a shiny new Viking Helmet!

1 Like

need help i always died every single time:cry:

need help on it

SLIDE = 8
SWITCH = 6
SKIP = 11

steps = 1
sideSteps = 1
X_PACE_LENGTH = 4
Y_PACE_LENGTH = 6
s=1

while steps < 35:
self.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
if steps % SWITCH == 0:
s = -s
if steps % SKIP == 0:
sideSteps += s
sideSteps += s
if sideSteps < 1:
sideSteps = SLIDE
if sideSteps > SLIDE:
sideSteps = 1
steps += 1

Can you just give me the code i cant find what im supposed to change in SLIDE = 8
SWITCH = 6
SKIP = 11

steps = 1
sideSteps = 1
X_PACE_LENGTH = 4
Y_PACE_LENGTH = 6
s=1

while steps <= 35:
self.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
if steps % SWITCH == 0:
s = -s
if steps % SKIP == 0:
sideSteps += s
sideSteps += s
if sideSteps < 1:
sideSteps = SLIDE
if sideSteps > SLIDE:
sideSteps = 1
steps += 1

Help me pleaseeeeeeeeeeeeeeeee! i need help

PLS HELP ME MY CODE IS NOT WORKING here have it
SLIDE = 8
SWITCH = 6
SKIP = 11

steps = 1
sideSteps = 1
X_PACE_LENGTH = 4
Y_PACE_LENGTH = 6
s=1

while steps <= 35:
self.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
if steps % SWITCH == 0:
s = -s
if steps % SKIP == 0:
sideSteps += s
sideSteps += s
if sideSteps < 1:
sideSteps = SLIDE
if sideSteps > SLIDE:
sideSteps = 1
steps += 1

hey i’m having trouble can you help me out cuz I really don’t know what to do pls help

hey guys if you want the code for lost viking i have it here

[Snipped, don’t provide correct code.]

Hey guys I’m doing the lost viking and I need some help. I (somehow) managed to finally get to the skeleton and the helmet! but it keeps on going until it says goals incomplete. I tried walking in circles around it but it acts as if I’m just standing in the middle of nowhere! do I need to type in hero.pickupshinyhelmetrightinfrontofme? please help

Are you sure it doesn’t work? it works perfectly for me. Post a screenshot.

Show the whole window.

Are you supposed to get to the outside of the forest?

You aren’t supposed to go out of the forest…

hm idk

You completed it and got the “Arcane Knowledge” right? Is it worth it?