[Reserved] Netease Wars geeks Official Guide - Dungeon - wise Attack!

Level connection: https://codecombat.163.com/play/level/attack-wisely

Free Trial: https://codecombat.163.com/play

After each door has Ogres-- which one should you choose? Lyman group created by the players.

The default code

# Do not step on fire trap!
hero.moveUp();
hero.moveRight ();
hero.moveUp ();  # delta remove this line

Some ogres powerful than others!

Only defeating the ogre can easily deal with.

Attack the door by name, and findNearestEnemy ogre attack.

 Upon completion, immediately run away (move x mark).

Overview

When you move, you look at small dot moving on the floor tiles, avoiding the wrong position.

If you do not know the name of the ogre, you can use the method findNearestEnemy glasses to get the ogre and a reference to the variable. When you call findNearestEnemy method, you must store the result in a variable, such as enemy2 (you can name).

When you call findNearestEnemy method, the variable will remember who the enemy is recent, so be sure to see the enemy call it when in the vicinity.

Wise Attack! solution

# Do not step on fire trap!
hero.moveUp();
hero.moveRight (2);
hero.moveUp();
# Some ogres powerful than others!
# Ogre can only beat easily deal with.
# Attack the door by name, and findNearestEnemy ogre attack.
hero.attack("Door B")
hero.moveUp(2);
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
hero.moveDown(2);
hero.moveRight (4);
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
hero.moveUp(3);
hero.moveRight ();
hero.moveDown(4);
hero.moveLeft(3);
hero.moveDown();
hero.moveLeft(2);
# After, immediately run away (move x mark).
 

Raiders made in the official teaching Wars geeks column, the original address is:

https://codecombat.163.com/news/jikezhanji-mingzhidegongji

Geek Wars - learn programming, with play!

 

 

Guess you like

Origin www.cnblogs.com/codecombat/p/12097864.html