[SOLVED] Help! Lost Viking

This is my code

SLIDE = 10
SWITCH = 7
SKIP = 11
# 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

# The maze is 35 steps along the X axis.
while steps <= 35:
    
    # Take the next step:
    hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
    if steps % SWITCH:
        hero.moveXY(sideSteps * X_PACE_LENGTH, steps * Y_PACE_LENGTH)
    if sideSteps % SWITCH:
        hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
    if steps % SKIP:
        hero.moveXY(sideSteps * X_PACE_LENGTH, steps * Y_PACE_LENGTH)
        hero.moveXY(sideSteps * X_PACE_LENGTH, steps * Y_PACE_LENGTH)
    if sideSteps % SKIP:
        hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
        hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
    # Increment steps and sideSteps as appropriate, taking into account the special rules.
    steps += 2
    sideSteps += 2

It worked well until the first turn, then my hero got blown up. Please HELP!!!

Hi,
First let’s look at this line:

You don’t want to miss out a step do you? You should only increment by one.
Inside all the if statements you don’t want to move, instead you should change the variables.
Also, not all the if statements should use %, some use other mathematical operators.
Also ‘steps % switch’ doesn’t mean anything. You need to check if it == something. What should it equal if the second no. goes into the first?
Remember this is a super challenge level. I could definitely not do it at the time when I unlocked it, and I still don’t 100% understand it, so if you can’t do it from here you may have to leave it until later.
Danny

3 Likes

After this bite of the pizza, you want to increment your toppings (sideSteps).

I don’t know if this is a bug, but I did nothing for Lost Viking and I passed it!
Lydia

4 Likes

Lmao, the system made a mistake, whenever some way says “I passed!” It marks it as the Solution.

2 Likes

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