Lol, I love it when that happens . Ok letâs fix that. Will you post your current code?
def findWeakestEnemy():
enemies = hero.findEnemies()
enemyIndex = 0
weakest = None
leastHealth = 99999
while enemyIndex < len(enemies):
enemy = enemies[enemyIndex]
if enemy.health < leastHealth:
weakest = enemy
leastHealth = enemy.health
return weakest
while True:
enemy = findWeakestEnemy()
if enemy:
hero.attack(enemy)
Oh wait. donât look at that one
I know why enemy doesnât work.
HmmmâŚwhat if you try entirely taking that line out?
enemies = hero.findEnemies()
And like I said, keep this as it was first. Below the 9999
it is because it is singular instead of plural. Being singular means it would be the weakest either way so you just end up attacking whatever one enemy it chooses instead of the weakest.
Uhhhh. that didnât work either.
âŚis this a sub level?
Yah. In Desert. Desert is bugging me. I just cant wait for glacierâŚ
Oh. Iâm not a sub, so I canât see my level. Plus, trying to see CoCo on a phone isnât helping either. Unless i can get on a computer, youâre going to have to wait, sorry.
That is fine. I can wait.
Thx though for trying.
I looked it up on GitHub. I changed my answer to match exactly. It doesnât work.
Wait a sec. Am I supposed to do
blank += 1
Alejandroâs name. Kinda funny
after that I broke it
Youâre not supposed to copy and paste since thatâs cheating and youâre not learning anything.
I didnât copy in paste. I just compared them. I kinda just gave up.