Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Lost Viking Level Help

I’m very confused about the Lost Viking level, I need some help!
I’ve read all the other post about Lost Viking but still confused.
Can anyone explaine to me about this level

Hi Ufy,

Welcome to the forum!

First thing to say is that Lost Viking is way more complicated than the other levels around it. If you’re new to coding then maybe leave it for now and come back to it. I had a look at it 3 or 4 times, and I didn’t complete it until I was on the mountain levels.

However, you asked so I’ll try to answer. You’re trying to write code so that the path the hero takes follows the line of flowers between the mines. You start by writing a loop based on ‘steps’, which looks something like:

        hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH);

This will take you on a diagonal line, going up. (If you try it, you’ll find you hit a mine after a few steps). The instructions then give things that you have to do to modify this loop (based on Slide, Skip and Switch). If you get these modifications right, your hero will move along the wiggly path right to the end. It’s quite hard to work out the order of these modifications so they all happen at the right time. To start, take them one at a time, and think about what you’re being asked to do, and what that would look like as code.

Expect to try it lots and lots of times to get it right (or maybe if you’re good at programming then it’s easier than that!), but it’s pretty satisfying when it finally works. Good luck :smile:.