syntax.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. >>> import adventure
  2. >>> adventure.play(seed=2)
  3. WELCOME TO ADVENTURE!! WOULD YOU LIKE INSTRUCTIONS?
  4. <BLANKLINE>
  5. >>> no
  6. YOU ARE STANDING AT THE END OF A ROAD BEFORE A SMALL BRICK BUILDING.
  7. AROUND YOU IS A FOREST. A SMALL STREAM FLOWS OUT OF THE BUILDING AND
  8. DOWN A GULLY.
  9. <BLANKLINE>
  10. >>> brief
  11. OKAY, FROM NOW ON I'LL ONLY DESCRIBE A PLACE IN FULL THE FIRST TIME
  12. YOU COME TO IT. TO GET THE FULL DESCRIPTION, SAY "LOOK".
  13. <BLANKLINE>
  14. This doctest exercises all of the different ways that people try to
  15. invoke Adventure commands from the Python prompt.
  16. Simple movement can be invoked simply by typing the direction, but some
  17. players will try to call them as functions instead.
  18. >>> s
  19. YOU ARE IN A VALLEY IN THE FOREST BESIDE A STREAM TUMBLING ALONG A
  20. ROCKY BED.
  21. <BLANKLINE>
  22. >>> n()
  23. YOU'RE AT END OF ROAD AGAIN.
  24. <BLANKLINE>
  25. That pretty much exhausts the possibilities when a word is being used
  26. alone as a command. But when two words are being combined, there are
  27. several different ways that they might be called!
  28. One word can be used as a function and the second as an argument:
  29. >>> goto(building)
  30. YOU ARE INSIDE A BUILDING, A WELL HOUSE FOR A LARGE SPRING.
  31. <BLANKLINE>
  32. THERE ARE SOME KEYS ON THE GROUND HERE.
  33. <BLANKLINE>
  34. THERE IS A SHINY BRASS LAMP NEARBY.
  35. <BLANKLINE>
  36. THERE IS FOOD HERE.
  37. <BLANKLINE>
  38. THERE IS A BOTTLE OF WATER HERE.
  39. <BLANKLINE>
  40. Or, a period can be used to separate the words. Note that nouns and
  41. verbs can be in either order.
  42. >>> get.keys
  43. OK
  44. <BLANKLINE>
  45. >>> lamp.get
  46. OK
  47. <BLANKLINE>
  48. Why do we support putting the noun and verb in either order? Because
  49. some users think of verbs as methods supported by the game's nouns, and
  50. will format their commands like method calls:
  51. >>> food.get()
  52. OK
  53. <BLANKLINE>