"Codecombat" trial all Raiders 18th end of the Kithman clan

Source: Internet
Author: User

The 18th and final Kithman clan

We find no, this is similar to the cycle before the cycle, follow the blue arrow, right, up, right, down, up, right to complete

a loop. It is obvious to use while true. Only the enemy in the middle, in the appropriate place add hero.attack (enemy)

Command.

  

The code is as follows:

1 #use loop loop to move and attack targets2 3  whileTrue:4 hero.moveright ()5 hero.moveup ()6enemy=Hero.findnearestenemy ()7 Hero.attack (Enemy)8 Hero.attack (Enemy)9 hero.moveright ()Ten Hero.movedown () One Hero.movedown () AHero.moveup ()

"Codecombat" to try the 18th Kithman family

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.