首页:https://cn.codecombat.com/play
语言:Python

第一界面:地牢 Kithgard(22关)
时间:1-3小时
内容:语法、方法、参数、字符串、循环、变量等
网页:https://cn.codecombat.com/play/dungeon

闯关:
第1关:地牢 Kithgard
子网页:https://cn.codecombat.com/play/level/dungeons-of-kithgard?

# 向宝石进发。
# 小心撞墙!
# 在下面输入你的代码。 hero.moveRight()
hero.moveDown()
hero.moveRight()

第2关:深藏的宝石
子网页:https://cn.codecombat.com/play/level/gems-in-the-deep?

# 利用你的移动命令收集所有宝石。

hero.moveRight()
hero.moveDown()
hero.moveUp()
hero.moveUp()
hero.moveRight()

第3关:幽灵守卫
子网页:https://cn.codecombat.com/play/level/shadow-guard?

# 避开食人魔的视线,夺取宝石。

hero.moveRight()
hero.moveUp()
hero.moveRight()
hero.moveDown()
hero.moveRight()

第4关:不详的征兆
子网页:https://cn.codecombat.com/play/level/signs-and-portents?

# 你的目标是保护地图右边的人存活。
# 你不需要和食人巨怪打,只管逃命!你的盟友会保护你。 hero.moveRight()
hero.moveRight()
hero.moveUp()
hero.moveRight()
hero.moveRight()
hero.moveRight()
hero.moveDown()
hero.moveRight()
hero.moveDown()
hero.moveRight()
hero.moveRight()

第5关:真实姓名
子网页:https://cn.codecombat.com/play/level/true-names?

# 抵抗Brak and Treg!
# 你必须攻击小食人魔两次。 hero.moveRight()
hero.attack("Brak")
hero.attack("Brak")
hero.moveRight()
hero.attack("Treg")
hero.attack("Treg")
hero.moveRight()
hero.moveRight()

第6关:高举之剑
子网页:https://cn.codecombat.com/play/level/the-raised-sword?

# 打败食人魔
# 记住,每个攻击两次。 hero.attack("Rig")
hero.attack("Rig")
hero.attack("Gurt")
hero.attack("Gurt")
hero.attack("Ack")
hero.attack("Ack")
hero.moveRight()

第7关:注解监狱
子网页:https://cn.codecombat.com/play/level/cell-commentary?

hero.say("密码是什么?")
# 使用"say()"函式来说出密码.
# 密码是: "Achoo" hero.say("Achoo")
hero.moveUp()
hero.moveUp()

第8关:kithguard的图书馆管理员
子网页:https://cn.codecombat.com/play/level/kithgard-librarian?

# 你需要图书馆大门的开门密码!
# 密码就在帮助指导页面中!
# 请点击代码窗口下的蓝色“帮助”按钮来打开关卡的帮助页面。
# 大多数关卡的帮助页面中有详细的帮助信息。如果你在关卡中遇到了困难,请点击“帮助”按钮! hero.moveRight()
hero.say("我还不知道密码呢!") # ∆
hero.say("Hush")
hero.moveRight()

第9关:焰中舞动
子网页:https://cn.codecombat.com/play/level/fire-dancing?

# 代码通常按写下的顺序执行
# 循环多次重复一个代码块
# 按Tab或4个空格把移动指令缩进在循环内部 while True:
hero.moveRight()
# 以下注释展示如何制造循环
hero.moveLeft()

第10关:循环又循环
子网页:https://cn.codecombat.com/play/level/loop-da-loop?

# 在 while true 里的代码会永远重复!

while True:
# 走起
hero.moveRight()
# 动起来
hero.moveUp()
# 左走
hero.moveLeft()
# 右走
hero.moveDown()

第11关:闹鬼迷宫
子网页:https://cn.codecombat.com/play/level/haunted-kithmaze?

# “loop” 能够让你更轻易地重复一件事

while True:
# 在这里添加命令来重复。
hero.moveRight()
hero.moveRight()
hero.moveUp()
hero.moveUp()

第12关:再次迷宫历险
子网页:https://cn.codecombat.com/play/level/the-second-kithmaze?

# 使用loop循环穿越迷宫!

while True:
hero.moveRight()
hero.moveUp()
hero.moveRight()
hero.moveDown()

第13关:恐惧之门
子网页:https://cn.codecombat.com/play/level/dread-door?

# 攻击大门(Door)
# 需要攻击很多次,请使用loop循环 while True:
hero.attack("Door")

第14关:已知敌人
子网页:https://cn.codecombat.com/play/level/known-enemy?

# 你可以用名称标签作为变量。

enemy1 = "Kratt"
enemy2 = "Gert"
enemy3 = "Ursa" hero.attack(enemy1)
hero.attack(enemy1)
hero.attack(enemy2)
hero.attack(enemy2)
hero.attack(enemy3)
hero.attack(enemy3)

第15关:名字大师
子网页:https://cn.codecombat.com/play/level/master-of-names?

# 你的英雄不知道这些敌人的名字!
# 这眼镜给了你 “findNearestEnemy” 寻找最近敌人的能力。 enemy1 = hero.findNearestEnemy()
hero.attack(enemy1)
hero.attack(enemy1) enemy2 = hero.findNearestEnemy()
hero.attack(enemy2)
hero.attack(enemy2) enemy3 = hero.findNearestEnemy()
hero.attack(enemy3)
hero.attack(enemy3)

第16关:近战
子网页:https://cn.codecombat.com/play/level/closing-the-distance?

hero.moveRight()

# 通过上一个关卡,你应该能认识这个。
enemy1 = hero.findNearestEnemy()
# 现在,攻击那个变量,
hero.attack(enemy1)
hero.attack(enemy1)
hero.moveRight() enemy2 = hero.findNearestEnemy()
hero.attack(enemy2)
hero.moveRight()

第17关:矮人骚乱
子网页:https://cn.codecombat.com/play/level/a-mayhem-of-munchkins?

# 在 while true循环里,使用 findNearestEnemy() 并攻击!

while True:
enemy = hero.findNearestEnemy()
hero.attack(enemy)

第18关:最后的Kithman族
子网页:https://cn.codecombat.com/play/level/the-final-kithmaze?

# 使用loop循环移动并攻击目标

while True:
hero.moveRight()
hero.moveUp()
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
hero.moveRight()
hero.moveDown()
hero.moveDown()
hero.moveUp()

第19关:Kithgard之门
子网页:https://cn.codecombat.com/play/level/kithgard-gates?

# 建造三个栅栏来隔离兽人!

hero.moveDown()
hero.buildXY("fence", 36, 34)
hero.buildXY("fence", 36, 30)
hero.buildXY("fence", 36, 27)
hero.moveRight()
hero.moveRight()
hero.moveRight()

【竞技AI】第20关:洞穴求生
子网页:https://cn.codecombat.com/play/level/cavern-survival?

# 生存时间比敌人的英雄长!
while True:
# 制定自己的战略。有创意!
enemy = hero.findNearestEnemy()
hero.attack(enemy)
if hero.distanceTo(enemy) < 3:
while hero.isReady("cleave"):
hero.cleave(enemy)

【挑战升级】第21关:Kithgard斗殴
子网页:https://cn.codecombat.com/play/level/kithgard-brawl?

第一次:

# 在一波波的食人魔攻击中活下来。
# 如果你赢了,本关会变得更难,但给更多的奖励。
# 如果你输了,你必须等一天之后才能重新提交。
# 每次提交都会获得新的随机种子。 while True:
enemy = hero.findNearestEnemy()
item = hero.findNearestItem()
while item:
hero.moveXY(item.pos.x, item.pos.y)
break
if enemy:
if hero.isReady("cleave"):
hero.cleave(enemy)
else:
hero.attack(enemy)

第二次:【未通关】

# 在一波波的食人魔攻击中活下来。
# 如果你赢了,本关会变得更难,但给更多的奖励。
# 如果你输了,你必须等一天之后才能重新提交。
# 每次提交都会获得新的随机种子。 while True:
flag = hero.findFlag("green")
enemy=hero.findNearestEnemy()
item = hero.findNearestItem()
if flag:
hero.pickUpFlag(flag)
if item:
hero.moveXY(item.pos.x, item.pos.y)
if enemy:
if hero.isReady("cleave"):
hero.cleave(enemy)
elif hero.isReady("bash"):
hero.bash(enemy)
else:
hero.attack(enemy)

【直接升级】第22关:Kithgard精通(每过段时间英雄的路线会更新,所以每个用户不完全一样)
子网页:https://cn.codecombat.com/play/level/kithgard-mastery?

# 使用移动命令到达迷宫的终点。
# 计算你收集到的宝石数量,然后在到达火球陷阱时通过说出当前的宝石数量来使陷阱失效。
# 在起点的地方会有一只乌鸦告诉你一个密码。在门的附近说出该密码来开门。
# 当你靠近食人魔时杀死它。
# 你可以在需要的时候使用loop来重复所有的指令。
# 如果你通过了这个关卡,你就可以直接跳到边远地区的森林! while True:
hero.moveRight()
hero.moveUp(2)
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.moveLeft()
hero.moveUp(2)
hero.moveRight(2)
hero.moveUp()
hero.moveDown()
hero.moveRight()
hero.moveDown(2)
hero.say("")
hero.say("")
hero.moveDown(2)
hero.say("Swordfish")
hero.moveRight(2)

初学Python。

请多指教。

-----转载请注明出处,否则作者有权追究法律责任。

[Python]Codecombat攻略之地牢Kithgard(1-22关)的更多相关文章

  1. [Python] Codecombat 攻略 地牢 Kithgard (1-22关)

    首页:https://cn.codecombat.com/play语言:Python 第一界面:地牢 Kithgard(22关) 时间:1-3小时 内容:语法.方法.参数.字符串.循环.变量等 网页: ...

  2. [Python]Codecombat攻略之远边的森林Forest(1-40关)

    首页:https://cn.codecombat.com/play语言:Python 第二界面:远边的森林Forest(40关)时间:2-6小时内容:if/else.关系操作符.对象属性.处理输入网页 ...

  3. [Python] Codecombat攻略 远边的森林 Forest (1-40关)

    首页:https://cn.codecombat.com/play语言:Python 第二界面:远边的森林Forest(40关)时间:2-6小时内容:if/else.关系操作符.对象属性.处理输入网页 ...

  4. [Python] Codecombat 攻略 Sarven 沙漠 (1-43关)截止至30关

    首页:https://cn.codecombat.com/play语言:Python 第二界面:Sarven沙漠(43关)时间:4-11小时内容:算术运算,计数器,while循环,break(跳出循环 ...

  5. [Python] Codecombat 攻略 Sarven 沙漠 (1-43关)截止至36关

    首页:https://cn.codecombat.com/play语言:Python 第二界面:Sarven沙漠(43关)时间:4-11小时内容:算术运算,计数器,while循环,break(跳出循环 ...

  6. python脚本攻略之log日志

    1 logging模块简介 logging模块是Python内置的标准模块,主要用于输出运行日志,可以设置输出日志的等级.日志保存路径.日志文件回滚等:相比print,具备如下优点: 可以通过设置不同 ...

  7. 网易极客战记官方攻略-地牢-Kithgard 地牢

    关卡连接: https://codecombat.163.com/play/level/dungeons-of-kithgard 夺取宝石,逃出地牢--注意不要触碰其他东西.在这个关卡里,你会学习编写 ...

  8. 网易极客战记官方攻略-地牢-Kithgard 图书管理员

    关卡连接: https://codecombat.163.com/play/level/kithgard-librarian 向友好的图书馆管理员求助! 简介 大多数关卡都有提示,在你卡关时挺有用. ...

  9. 【转载】网易极客战记官方攻略-地牢-Kithgard 橱柜 A

    关卡连接: https://codecombat.163.com/play/level/cupboards-of-kithgard-a 谁知道什么样的恐怖事情潜伏在 Kithgard 的橱柜里? 简介 ...

随机推荐

  1. webarchive文件转换成htm文…

    原文地址:webarchive文件转换成htm文件作者:xhbaxf Mac OS X系统带有文件转换功能,可以把webarchive文件变成html文件.方法是:   Step 1: 建立一个文件夹 ...

  2. MacOS下免密码ssh登陆

       由于配置过程中需要频繁的进行ssh连接到开发服务器执行命令以及通过scp命令向服务器拷贝文件等依赖ssh连接的操作.所以,配置本地环境跟服务器之间的ssh免密码连接可以有效的提升工作效率.    ...

  3. 【beta】阶段 第六次 Scrum Meeting

    每日任务 1.本次会议为第六次 Meeting会议: 2.本次会议在周六上午大课间,在陆大楼召开,召开本次会议为15分钟. 一.今日站立式会议照片 二.每个人的工作 (有work item 的ID) ...

  4. 团队作业7——Alpha冲刺之事后诸葛亮(宣告项目失败团队解散)

    一.项目进度 1.4月5日,团队组建.满怀希望的能做好这个项目 2.4月12日,需求分析. 3.4月21日,需求改进,出现协作问题,没有做好. 4.做项目,学习新的知识,继续做项目,但是能力有限,团队 ...

  5. 201521123001《Java程序设计》第3周学习总结

    1. 本周学习总结 2. 书面作业 1. 代码阅读 public class Test1 { private int i = 1;//这行不能修改 private static int j = 2; ...

  6. Java:设计类的继承关系时的技巧

    继承设计的技巧: (1)将公共操作和域放置在超类 (2)不要使用受保护的域 有些程序员认为,将大多数的实例域定义为protected是一个不错的主意,只有这样,子类才能够在需要的时候直接访问他们.然而 ...

  7. Could not execute JDBC batch update; SQL [delete from role where roleId=?]; constraint [null]; neste

    今天在写多个删除功能的时候出现了这么一个错误:意思是删除操作的时候,没有找到对应的外键. Cannot delete or update a parent row: a foreign key con ...

  8. 举例让抽象问题具体化:包含min函数的栈

    定义栈的数据结构,请在该类型中实现一个能够得到栈最小元素的min函数.在该栈中,调用min.push及pop的时间复杂度都是O(1). import java.util.Stack; public c ...

  9. Apache Spark 2.2.0 中文文档 - Spark 编程指南 | ApacheCN

    Spark 编程指南 概述 Spark 依赖 初始化 Spark 使用 Shell 弹性分布式数据集 (RDDs) 并行集合 外部 Datasets(数据集) RDD 操作 基础 传递 Functio ...

  10. 一款简单而不失强大的前端框架——【Vue.js的详细入门教程①】

    ↓— Vue.js框架魅力 —↓ 前言       Vue.js 是一个构建数据驱动的 web 界面的渐进式框架.Vue.js 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件.V ...