AlexeySapsay / Python_solution_CodeCombat_2018

In that repository I will post my sollution for codecombat.com games for study Python
1 stars 0 forks source link

Recruiting Queue #153

Open AlexeySapsay opened 6 years ago

AlexeySapsay commented 6 years ago
# Follow me on youtube  channel Phy Tu
# Help with programming on Python, school math, physics
# https://www.youtube.com/channel/UCP5ycahCEZ24qmRRgNnko5Q

# Call peasants one after another.

# Neutral units are detected as enemies.
neutrals = hero.findEnemies()
while True:
    if len(neutrals)>0:
        # Say the first unit in the neutrals array
        hero.say(neutrals[0])
        pass
    else:
        hero.say("Nobody here")

    # Reassign the neutrals variable using findEnemies()
    neutrals=hero.findEnemies()