[Solved] Lost Viking need Help!

I’m confused how Lost Viking works
here is my code:

SLIDE = 2
SWITCH = 6
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)
    
    # Increment steps and sideSteps as appropriate, taking into account the special rules.
    steps += 1
    sideSteps += 1
    

Tell me, why do you post everything under the “adventurer” category? It’s clearly stated what it is for:
image
…and as this level has been around for years, you definitely should not be posting your question here.


And then: why don’t you use search? There are already at least 10 topics for the same level: https://discourse.codecombat.com/search?q=lost%20viking

I presume that you will find the answer to your question(s) in one of those.

1 Like

I guess i wasn’t paying attention to category i was in

The funny things is, you can just shoot the Green eyed burl, wait in a spot lower than the blast radius, and then got to the end coordinate(marked by a FLOWER!), and then you can set the stupid steps to 35. >.<

The ending position of the hero and the steps being set to 35 are the ONLY ways to get to the coding!

help

sideSteps = 1

# Как много steps(шагов) к востоку от Красного Креста вы сделали.
steps = 1

# Перемножьте это с количеством шагов на восток(step), чтобы определить свою X координату. НЕ ИЗМЕНЯЙТЕ ЭТО!
X_PACE_LENGTH = 4

# Перемножьте это с количеством шагов к северу(sideSteps), чтобы определить свою Y координату. НЕ ИЗМЕНЯЙТЕ ЭТО!
Y_PACE_LENGTH = 6
SWITCH = 6
SLIDE = 8
SKIP = 11
sidemove = 1
# Лабиринт это 35 шагов вдоль Оси X.
while steps <= 35:
    # Сделайте следующий шаг:
    hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH)
    if (steps % SWITCH == 0):
        sidemove = sidemove * -1
    sideSteps += sidemove
    if (steps % SKIP == 0):
        sideSteps = sideSteps + sidemove
    if (sideSteps > SLIDE):
        sideSteps = sideSteps - SLIDE
    if (sideSteps < 1):
        sideSteps = sideSteps + SLIDE
        # Увеличивайте steps(шаги) и sideSteps(шаги в сторону) по необходимости, принимая во внимание специальные правила.
    steps += 1
1 Like

hero.moveXY(16, 25)
hero.moveXY(25, 25)
hero.moveXY(33, 5)
hero.moveXY(35, 48)
hero.moveXY(46, 43)
hero.moveXY(47, 5)
hero.moveXY(58, 25)
hero.moveXY(68, 17)
hero.moveXY(87, 17)
hero.moveXY(96, 32)
hero.moveXY(103, 32)
hero.moveXY(111, 19)
hero.moveXY(127, 14)
hero.moveXY(138, 25)
hero.moveXY(143, 47)
this is my way code

Please format your code using the code button (the 6th button in the bar)

hero.moveXY(16, 25)
hero.moveXY(25, 25)
hero.moveXY(33, 5)
hero.moveXY(35, 48)
hero.moveXY(46, 43)
hero.moveXY(47, 5)
hero.moveXY(58, 25)
hero.moveXY(68, 17)
hero.moveXY(87, 17)
hero.moveXY(96, 32)
hero.moveXY(103, 32)
hero.moveXY(111, 19)
hero.moveXY(127, 14)
hero.moveXY(138, 25)
hero.moveXY(143, 47)
this is my way code

Hello and welcome to the forum :partying_face:
Can you please format your code properly using this button:
image

2 Likes

this is a great tip (20 letters uggg)

you can straight up cheese the level by doing this with Arrowhead(the hero)

hero.attack(“Teemer”)
hero.wait(1)
hero.moveXY(0, 0)
hero.wait(3)

The raven will tell you what to use for your maze parameters!

hero.moveXY(143, 37)

…that’s exactly what Jason said……