Not the greatest title i know, alright, consider:
for (var i = 0; i < map.length; ++i) {
place_ore(mountain_ore,mountain_allowed_ores)
}
And inside place_ore(), I am trying to access map[i];, however when I try to do this, it gives me an undefined error. I think it has something to do with scope, but I can't quite work it out myself, any ideas?
Thanks.
idoesn't exist inside the function..you can always passiin as another variable.place_ore? Does it allow a third parameter?