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!
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!
I donât know if getting away with using strings is okay XD.
The originally intended way was pretty straight forward.
Hi wyd can be a good people
By Alantis
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.
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].
i donât use cofee script but i use python
oh and if i begin whit 0 it says the same thing
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])
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
still not working!
Can you show me your recent code?
Andrei
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"