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

Second Gem #154

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

# One gem is safe, the others are bombs.
# But you know the answer: always take the second.

while True:
    items = hero.findItems()
    # If the length of items is greater or equal to 2:
    if len(items)>=2:
        # Move to the second item in items
        hero.moveXY(items[1].pos.x,item[1].pos.y)
    # Else:
    hero.say("I need to wait")
    # Move to the center mark.
    hero.moveXY(40,34)