[Adventurer] Northwest

Mountain level Northwest is ready for testing.

Listen to local guides and guide your pet through mountain tracks which are full by traps. Use string search to recognize guides’ orders.

3 Likes

This comment is misleading

# If j is the length of the word:
           

Better is:

# If j is the last letter of the word:
4 Likes

Thanks for the tips! I almost couldn’t complete this level :stuck_out_tongue: I still feel like I should watch a video / visualization of string search algorithm to understand it fully though.

1 Like

good point. Thx.

That level should be placed after “Ice Hunter” where you can see the demo for this Naive algorithm.

1 Like

I can’t get this one to work either. It doesn’t want to do any of the text searching code. But, Ice Hunter worked just fine!

1 Like

sessionID? code example? Please, give me something to understand your problem :slight_smile:

1 Like

@juraj_pechac How about:

If j is equal to the position of the last letter in word

As j is not a character letter itself but the index.

1 Like

@Bryukh finished the level without issue with my default gear for that point in the game.

When the level completed and I looked at the leaderboards it kicked me back to the world campaign selection:

I submitted a grammar patch
I submitted a LUA patch

note: LUA is having scoping issues so I had to create the additional function as a method on pet so that the other declared function could call the pet.wordInText function


LUA patch information for players, go here if the patch is still in development for help with default code:

You are right, this is most precise.

Don’t forget about lengths of comments line. The result length (with whitespaces) should not be more than 59 characters.

1 Like

@Bryukh Thank you for reminding me. Would we then just break out the comment into 2 lines vs 1?

If it’s possible to write it in one line, then it’s better. Otherwise, two lines are acceptable, but it’s better to make them similar in size.

default function was too complicated. so


1 Like

Do you think I don’t know how to solve most of the levels with one-liners? :wink:

1 Like

actually I was reading description of the default function and don’t get how it’s work

This one part is ruining the entire level for me.


I can’t understand for the life of me how to do this.
(Includes one of my many failed attempts)

Have you played desert levels (and some mountains) about array indexes?

word.length - 1

Yes I have, they tend to confuse me a lot though.

Also, I changed my solution to your line and nothing changed :confused:

It wasn’t a line. Just an expression. So you passed all arrays levels before but don’t know how to get the last index of the array(string).

I can’t say why you code doesn’t work without the code.