Hello!
I have this error in python solution:
Error Cannot read property ‘start’ of undefined
This is my code on this level:
def bestValue(item):
return item.value / hero.distanceTo(pet.fetch(item)
def findGoodItem(items):
g_item = items[0]
for item in items:
if BestValue(item)>BestValue(g_item):
g_item = item
return g_item
while True:
item = findGoodItem(hero.findItems())
hero.move(item)
if hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
enemy = hero.findNearest(hero.findEnemies())
if enemy:
soldiers = hero.findFriends()
for soldier in soldiers:
hero.command(soldier, "attack", enemy
while enemy.health>0:
hero.attack(enemy)