[Adventurer] Northwest


#1

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.


#2

This comment is misleading

# If j is the length of the word:
           

Better is:

# If j is the last letter of the word:

#3

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.


#4

good point. Thx.

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


#5

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!


#6

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


#7

@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.


#8

@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:


#9

You are right, this is most precise.


#10

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


#11

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


#12

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.


#13

default function was too complicated. so



#14

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


#15

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


#16

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)


#17

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

word.length - 1


#18

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

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


#19

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.