Lost Viking Code Help


#1

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!


#2

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.


#3

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


#4

need help i always died every single time:cry:


#5


#6

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


#7

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


#8

Help me pleaseeeeeeeeeeeeeeeee! i need help


#9

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


#10

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


#11

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

[Snipped, don’t provide correct code.]


#12

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


#13

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


#14

28%20PM


#15


#16

Show the whole window.


#17


#18

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


#19

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

hm idk


#20

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