Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- # เคลื่อนไปหาเพชร
- # อย่าแตะหนามแหลม!
- # เขียนโค๊ตคุณลงข้างล่างแล้วกดปุ่ม เล่น เมื่อเสร็จแล้ว
- hero.moveRight()
- hero.moveDown()
- hero.moveRight()
- 2.
- # เก็บเพชรทุกเม็ดโดยใช้คำสั่งเคลื่อนไหว
- hero.moveRight()
- hero.moveDown()
- hero.moveUp()
- hero.moveRight()
- hero.moveUp()
- hero.moveLeft()
- 3.
- # พยายามอย่าให้ยักษ์เห็น เก็บเพชรทุกเม็ด
- hero.moveRight()
- hero.moveUp()
- hero.moveRight()
- hero.moveDown()
- hero.moveRight()
- 4.
- # ใช้อากิวเม้นเพื่อเคลื่อนที่ได้ไกลมากขึ้น
- hero.moveRight(3)
- hero.moveUp()
- hero.moveRight()
- hero.moveDown(3)
- hero.moveRight(2)
- 5.
- # ป้องกันการรุกรานจาก Brak และ Treg!
- # คุณต้องโจมตีพวกอ๊อคเป็นจำนวน 2 ครั้ง
- hero.moveRight()
- hero.attack("Brak")
- hero.attack("Brak")
- hero.moveRight()
- hero.attack("Treg")
- hero.attack("Treg")
- 6.
- hero.say("รหัสผ่านคืออะไร?")
- # ใช้ฟังก์ชั่น "say()" เพื่อพูดรหัสผ่าน
- # รหัสผ่านคือ: "Achoo"
- hero.say("Achoo")
- hero.moveUp(2)
- 7.
- # You need to say a password to open the Library Door!
- # The password is in the Hints!
- # Click the blue Hints button above the code window.
- # If you ever get stuck, click Hints!
- hero.moveRight()
- hero.say("Hush")
- hero.moveRight()
- 8.
- # Free the prisoner, defeat the guard and grab the gem.
- hero.moveRight()
- # ช่วยแพทริคจาก เดอะวีคดอร์
- hero.attack("Weak Door");
- # สังหารคนคุ้มกัน ที่ชื่อ "Two"
- hero.moveRight(3)
- hero.moveDown()
- hero.attack("Two")
- hero.attack("Two")
- hero.attack("Two")
- hero.moveDown(2)
- # รับเพชร
- 9.
- # Code normally executes in the order it's written.
- # Loops repeat a block of code multiple times.
- # Use tab or 4 spaces to indent the move lines under the loop.
- while True:
- hero.moveRight();
- hero.moveLeft();
- 10.
- # Loops are a better way of doing repetitive things.
- while True:
- # Add commands in here to repeat.
- hero.moveRight()
- hero.moveRight()
- hero.moveUp(2)
- 11.
- # Navigate the maze in less than 5 statements.
- while True:
- hero.moveRight(2)
- hero.moveDown()
- 12.
- # Attack the door!
- # It will take many hits, so use a "while-true" loop.
- while True:
- hero.attack("Door")
- 13.
- # You can write code before a loop.
- hero.moveRight()
- # Break open the "Chest" before using the loop to escape themaze!
- hero.moveUp()
- hero.attack("Chest")
- hero.moveDown()
- # Return back back into the main hallway.
- while True:
- # Move 3 times.
- hero.moveRight(3)
- # Move 3 times more.
- hero.moveDown(3)
- 14.
- # There may be something around to help you!
- # First, move to the Cupboard.
- hero.moveUp()
- hero.moveRight(2)
- hero.moveDown(2)
- # Then, attack the "Cupboard" inside a while-true loop.
- while True:
- hero.attack("Cupboard")
- 15.
- # You can use a variable like a nametag.
- x = "Kratt"
- z = "Gert"
- c = "Ursa"
- hero.attack(x)
- hero.attack(x)
- hero.attack(z)
- hero.attack(z)
- hero.attack(c)
- hero.attack(c)
- 16.
- # Your hero doesn't know the names of these enemies!
- # Use the findNearestEnemy method on your new glasses.
- # Assign the result of hero.findNearestEnemy() to the variable z:
- z = hero.findNearestEnemy()
- # z now refers to the nearest enemy. Use the variable to attack!
- hero.attack(z)
- hero.attack(z)
- # Now that z is defeated, calling hero.findNearestEnemy() again will result in finding the new nearest enemy.
- x = hero.findNearestEnemy()
- hero.attack(x)
- hero.attack(x)
- # Assign the result of hero.findNearestEnemy() to the variable c:
- c = hero.findNearestEnemy()
- hero.attack(c)
- hero.attack(c)
- # Now attack using the enemy3 variable:
- hero.attack(c)
- hero.attack(c)
- 17.
- # Use a while-true loop to both move and attack.
- while True:
- hero.moveRight()
- hero.moveUp()
- hero.moveRight()
- z = hero.findNearestEnemy()
- hero.attack(z)
- hero.attack(z)
- hero.moveDown(2)
- hero.moveUp()
- pass
- 18.
- # Build 3 fences to keep the ogres at bay!
- hero.moveDown()
- hero.buildXY("fence", 36, 34)
- hero.buildXY("fence", 36, 31)
- hero.buildXY("fence", 36, 27)
- hero.moveRight(3)
- จบไอ้สัส 555
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement