[Adventurer] Desert Delta

Another new Desert level here: Desert Delta

It is meant to be the introductory level to using hard-coded array indexes.

Let me know if you see any problems!

2 Likes

I don’t know if getting away with using strings is okay XD.

The originally intended way was pretty straight forward.

2 Likes

Hi wyd can be a good people
By Alantis

1 Like

Lua code doesn’t seem to be setup yet.

completed without issue.

added LUA patch

Got it, thanks Harry.

I started the level with complete code and beat the level instantly. Great level!

If anyone needs help with this level, use a warrior. I tried with Naria and it didn’t work, but when I tried with Hattori, it worked.

1 Like

Thank you @Hexagon2059662, I was stuck in this level for a while, you give me the reason why.

what is wrong whit my code
local enemyNames = {“Kog”, “Godel”, “Vorobun”, “Rexxar”}

hero:attack(enemyNames[1])
hero:attack(enemyNames[2])
– Attack enemyNames[3]:
hero:attack(enemyNames[3])
– Attack the last element:
hero:attack(enemyNames[4])

cause it says
cannot read property ‘line’ or is indefinite

Howdy and welcome to the forum!

When posting your code, please be sure it is properly formatted. You can learn how to do this here: [Essentials] How To Post/Format Your Code Correctly

It appears that you are using CoffeeScript. Just be aware that CS is experimental and may not be fully supported on every level.

Anyway, your array, ‘enemyNames = {“Kog”, “Godel”, “Vorobun”, “Rexxar”}’, has 4 elements, but don’t forget that most things in programming always start at zero [0].

1 Like

i don’t use cofee script but i use python

oh and if i begin whit 0 it says the same thing

Can you send us your code formated as it is described here?

Andrei

1 Like
local enemyNames = {"Kog", "Godel", "Vorobun", "Rexxar"}

hero:attack(enemyNames[1])
hero:attack(enemyNames[2])
-- Attack enemyNames[3]:
hero:attack(enemyNames[2])
-- Attack the last element:
hero:attack(enemyNames[3])
1 Like

I can see that you use CoffeScript. Phyton does not use – as for the comment mark, but uses # for it.
As for the code, even if I do not have much CoffeScript experience, I might be able to help.

Here try to attack enemyNames[3].

Here try to attack enemyNames[4] instead.

Andrei

1 Like

still not working!

Can you show me your recent code?

Andrei

1 Like

Look at it this way:

-- ????:
local enemyNames = {"Kog", "Godel", "Vorobun", "Rexxar"}

# Python:
enemyNames = ["Kog", "Godel", "Vorobun", "Rexxar"]

# translated:
enemyNames[0] = "Kog"
enemyNames[1] = "Godel"
enemyNames[2] = "Vorobun"
enemyNames[3] = "Rexxar"
1 Like