Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. 1.
  2.  
  3. # เคลื่อนไปหาเพชร
  4. # อย่าแตะหนามแหลม!
  5. # เขียนโค๊ตคุณลงข้างล่างแล้วกดปุ่ม เล่น เมื่อเสร็จแล้ว
  6.  
  7. hero.moveRight()
  8. hero.moveDown()
  9. hero.moveRight()
  10.  
  11. 2.
  12.  
  13. # เก็บเพชรทุกเม็ดโดยใช้คำสั่งเคลื่อนไหว
  14.  
  15. hero.moveRight()
  16. hero.moveDown()
  17. hero.moveUp()
  18. hero.moveRight()
  19. hero.moveUp()
  20. hero.moveLeft()
  21.  
  22. 3.
  23.  
  24. # พยายามอย่าให้ยักษ์เห็น เก็บเพชรทุกเม็ด
  25. hero.moveRight()
  26. hero.moveUp()
  27. hero.moveRight()
  28. hero.moveDown()
  29. hero.moveRight()
  30.  
  31. 4.
  32.  
  33. # ใช้อากิวเม้นเพื่อเคลื่อนที่ได้ไกลมากขึ้น
  34. hero.moveRight(3)
  35. hero.moveUp()
  36. hero.moveRight()
  37. hero.moveDown(3)
  38. hero.moveRight(2)
  39.  
  40. 5.
  41.  
  42. # ป้องกันการรุกรานจาก Brak และ Treg!
  43. # คุณต้องโจมตีพวกอ๊อคเป็นจำนวน 2 ครั้ง
  44.  
  45. hero.moveRight()
  46. hero.attack("Brak")
  47. hero.attack("Brak")
  48. hero.moveRight()
  49. hero.attack("Treg")
  50. hero.attack("Treg")
  51.  
  52. 6.
  53.  
  54.  
  55.  
  56. hero.say("รหัสผ่านคืออะไร?")
  57. # ใช้ฟังก์ชั่น "say()" เพื่อพูดรหัสผ่าน
  58. # รหัสผ่านคือ: "Achoo"
  59. hero.say("Achoo")
  60. hero.moveUp(2)
  61.  
  62. 7.
  63.  
  64. # You need to say a password to open the Library Door!
  65. # The password is in the Hints!
  66. # Click the blue Hints button above the code window.
  67. # If you ever get stuck, click Hints!
  68. hero.moveRight()
  69. hero.say("Hush")
  70. hero.moveRight()
  71.  
  72.  
  73.  
  74. 8.
  75.  
  76. # Free the prisoner, defeat the guard and grab the gem.
  77.  
  78. hero.moveRight()
  79. # ช่วยแพทริคจาก เดอะวีคดอร์
  80. hero.attack("Weak Door");
  81. # สังหารคนคุ้มกัน ที่ชื่อ "Two"
  82. hero.moveRight(3)
  83. hero.moveDown()
  84. hero.attack("Two")
  85. hero.attack("Two")
  86. hero.attack("Two")
  87. hero.moveDown(2)
  88.  
  89.  
  90. # รับเพชร
  91.  
  92. 9.
  93.  
  94. # Code normally executes in the order it's written.
  95. # Loops repeat a block of code multiple times.
  96. # Use tab or 4 spaces to indent the move lines under the loop.
  97.  
  98. while True:
  99. hero.moveRight();
  100. hero.moveLeft();
  101.  
  102.  
  103. 10.
  104.  
  105. # Loops are a better way of doing repetitive things.
  106.  
  107. while True:
  108. # Add commands in here to repeat.
  109. hero.moveRight()
  110. hero.moveRight()
  111. hero.moveUp(2)
  112.  
  113.  
  114. 11.
  115.  
  116. # Navigate the maze in less than 5 statements.
  117. while True:
  118. hero.moveRight(2)
  119. hero.moveDown()
  120.  
  121.  
  122.  
  123. 12.
  124.  
  125. # Attack the door!
  126. # It will take many hits, so use a "while-true" loop.
  127.  
  128. while True:
  129. hero.attack("Door")
  130.  
  131. 13.
  132.  
  133. # You can write code before a loop.
  134. hero.moveRight()
  135. # Break open the "Chest" before using the loop to escape themaze!
  136. hero.moveUp()
  137. hero.attack("Chest")
  138. hero.moveDown()
  139.  
  140. # Return back back into the main hallway.
  141.  
  142. while True:
  143. # Move 3 times.
  144. hero.moveRight(3)
  145. # Move 3 times more.
  146. hero.moveDown(3)
  147.  
  148.  
  149.  
  150. 14.
  151.  
  152.  
  153. # There may be something around to help you!
  154.  
  155. # First, move to the Cupboard.
  156. hero.moveUp()
  157. hero.moveRight(2)
  158. hero.moveDown(2)
  159. # Then, attack the "Cupboard" inside a while-true loop.
  160. while True:
  161. hero.attack("Cupboard")
  162.  
  163. 15.
  164.  
  165. # You can use a variable like a nametag.
  166.  
  167. x = "Kratt"
  168. z = "Gert"
  169. c = "Ursa"
  170.  
  171. hero.attack(x)
  172. hero.attack(x)
  173.  
  174. hero.attack(z)
  175. hero.attack(z)
  176.  
  177. hero.attack(c)
  178. hero.attack(c)
  179.  
  180. 16.
  181.  
  182. # Your hero doesn't know the names of these enemies!
  183. # Use the findNearestEnemy method on your new glasses.
  184.  
  185. # Assign the result of hero.findNearestEnemy() to the variable z:
  186. z = hero.findNearestEnemy()
  187. # z now refers to the nearest enemy. Use the variable to attack!
  188. hero.attack(z)
  189. hero.attack(z)
  190.  
  191. # Now that z is defeated, calling hero.findNearestEnemy() again will result in finding the new nearest enemy.
  192. x = hero.findNearestEnemy()
  193. hero.attack(x)
  194. hero.attack(x)
  195.  
  196. # Assign the result of hero.findNearestEnemy() to the variable c:
  197. c = hero.findNearestEnemy()
  198. hero.attack(c)
  199. hero.attack(c)
  200. # Now attack using the enemy3 variable:
  201. hero.attack(c)
  202. hero.attack(c)
  203.  
  204.  
  205. 17.
  206.  
  207. # Use a while-true loop to both move and attack.
  208.  
  209. while True:
  210. hero.moveRight()
  211. hero.moveUp()
  212. hero.moveRight()
  213. z = hero.findNearestEnemy()
  214. hero.attack(z)
  215. hero.attack(z)
  216. hero.moveDown(2)
  217. hero.moveUp()
  218.  
  219. pass
  220.  
  221. 18.
  222.  
  223.  
  224. # Build 3 fences to keep the ogres at bay!
  225.  
  226. hero.moveDown()
  227. hero.buildXY("fence", 36, 34)
  228. hero.buildXY("fence", 36, 31)
  229. hero.buildXY("fence", 36, 27)
  230. hero.moveRight(3)
  231.  
  232.  
  233.  
  234. จบไอ้สัส 555
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement