Please help on Lurkers [SOLVED]


#1
enemies = self.findEnemies()
enemyIndex = 0
    while enemyIndex < enemies.length:
        enemy = enemies[enemyIndex] 
            if enemy.type == 'shaman':
               while enemy.health > 0:
                    self.attack(enemy)
                    enemyIndex += 1

#2

Mostly this is a structural problem. Your first while loop should be aligned all the way to the left. If enemy.type should be aligned directly under the enemy definition and the last line should be four spaces (one tab) over from the left.


#3

Isn’t there a butten that fixes that? If you didn’t understand.


#4

No, learning to properly structure your code is part of learning to code. It’s up to you to do that.


#5

I use the button to help me know what to do so I can do it in the future.


#6

Thanks so much!

I can’t beleive all I had to do was move lines around. ;c