CodeCombat, Exciting ROL game to LEARN to PROGRAM !!! Clan Steemit!

in #programming8 years ago
... Later levels become more challenging as you progress ...


After Passing through the Dungeon of KithGard


Where we could learn to move on the map, avoid traps, kill ogres by calling them by their names, and other enemies with a search command to attack, we are now in the ISOLATED FOREST.

In the Isolated Forest we will see much more action and we will have to build walls and defend villagers like any good hero of ROL ...


Here I leave 2 of my last Battles and in the end a count of what we saw previously in the previous posts and some other interesting for programmers ...


WOODLAND CLEAVER

Now it turns out we are butchers ... In the lie

We have been given a new sword, and in CodeCombat as we are learning to program a new sword means a new command or several more.


We now have the command Cleave and isReady, it is actually the same, only isReady is to verify that Cleave is loaded and use it.


For example we can see the code here but do not cheat learn on your own think a little:

# Use your new "cleave" skill as often as you can.

hero.moveXY(23, 23)
while True:
    enemy = hero.findNearestEnemy()
    if hero.isReady("cleave"):
        # Cleave the enemy!
        hero.cleave(enemy)
        pass
    else:
        # Else (if cleave isn't ready), do your normal attack.
        hero.attack(enemy)
        pass

First check if we have enemies nearby, then we enter a While loop that is usually used in the game for interactions where we do not know well what is going to happen, and on entering we check if we have the Cleave loaded if the answer is True, then We make the super hit, otherwise we will strive like a normal game until it loads.

Well I will tell you that there is a little trick to pass this level and I will not tell you for now ask in the comments, who knows if we can arm Steemit clan.



Until the next time God bless them and bless them...

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.029
BTC 62178.11
ETH 2509.69
USDT 1.00
SBD 2.66