zoukankan      html  css  js  c++  java
  • 「网易官方」极客战记(codecombat)攻略-沙漠-诅咒谷-cursed-valley

    (点击图片进入关卡)

    这太热了,太热了。 专注在你的任务上,不要被炎热分心。

    简介

    炎热的太阳正在耗尽英雄的生命值! 保存你的力量!

    只有在 enemy.team 是 "ogres" 和 enemy.type 是 "skeleton" 时才会被攻击。

    除非 item.type 是 "potion" 并且 hero.health 小于 hero.maxHealth / 4 ,否则不要收集任何项目。

    默认代码

    # 炎热的太阳正在耗尽英雄的生命值!

     

    while True:
        enemy = hero.findNearestEnemy()
        # 攻击!如果敌人存在且enemy.team 为 "ogres"
        # 并且 enemy.type是 "skeleton"
        if enemy and enemy.team == "ogres" and enemy.type == "skeleton":
            hero.attack(enemy)

     

        item = hero.findNearestItem()
        # 收集物品,如果物品存在且 item.type是"potion"
        # 并且 hero.health小于hero.maxHealth / 4

    概览

    被诅咒的墓地是一个危险的地方!

    确保检查骨架的类型,以便英雄不会攻击任何牦牛。 还要确保只攻击 "ogres" 团队中的骷髅。

    对物品做同样的事情。 如果英雄的生命值低于 hero.maxHealth / 4 ,那么只能拿到药水。

    诅咒谷 解法

    # 炎热的太阳正在耗尽英雄的生命值!

     

    while True:
        enemy = hero.findNearestEnemy()
        # 攻击!如果敌人存在且enemy.team 为 "ogres"
        # 并且 enemy.type是 "skeleton"
        if enemy and enemy.team == "ogres" and enemy.type == "skeleton":
            hero.attack(enemy)

     

        item = hero.findNearestItem()
        # 收集物品,如果物品存在且 item.type是"potion"
        # 并且 hero.health小于hero.maxHealth / 4
        if item and item.type == "potion" and hero.health < hero.maxHealth / 4:
            hero.move(enemy)
     
    本攻略发于极客战记官方教学栏目,原文地址为:
  • 相关阅读:
    [转]nginx+fastcgi+c/c++搭建高性能Web框架
    [转]向facebook学习,通过协程实现mysql查询的异步化
    [转]ReactPHP── PHP版的Node.js
    [转]nodejs npm常用命令
    [LINK]php的三种CLI常量:STDIN,STDOUT,STDERR
    苹果iPhone如何区分港版、国行、水货
    16进制字符串转36进制字符串
    设置apache https服务
    [转]Class 'ThinkLog' not found
    PHP PSR规范
  • 原文地址:https://www.cnblogs.com/codecombat/p/13183917.html
Copyright © 2011-2022 走看看