ralphmerridew

Untitled

Jul 20th, 2011
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. "Keys on the Tomb"
  2.  
  3. kings_tomb is a room. The printed name is "The King's Tomb". "Old and dusty."
  4. The tomb is a supporter in kings_tomb.
  5.  
  6. A key is a kind of thing. Understand "keys" as the plural of key.
  7.  
  8. The player holds a rock.
  9. The player holds a key called the iron key.
  10. The player holds a key called the silver key.
  11. The player holds a book.
  12. The player holds a key called the brass key.
  13. The player holds a key called the gold key.
  14. The player holds a key called the bronze key.
  15. The player holds a container called the knapsack.
  16.  
  17. Key vault is a container.
  18.  
  19.  
  20. After putting a key on the tomb:
  21. say "You hear a jingle and [the noun] disappears.";
  22. move the noun to the key vault;
  23. if the number of keys in the key vault >= 5:
  24. say "You hear a creak as the tomb opens up...";
  25. end the game in victory.
  26.  
  27.  
  28. [
  29. After putting a key on the tomb:
  30. let m_o_l be the multiple object list;
  31. let placed_keys be a list of objects;
  32. repeat with obj running through m_o_l:
  33. if obj is a key:
  34. add obj to placed_keys;
  35. if the number of entries in placed_keys <= 1:
  36. say "You hear a jingle and [the noun] disappears.";
  37. move the noun to the key vault;
  38. otherwise:
  39. say "You hear a jingle and [placed_keys with definite articles] disappear.";
  40. repeat with removed key running through placed_keys:
  41. move the removed key to the key vault;
  42. remove noun from placed_keys;
  43. remove placed_keys from m_o_l;
  44. alter the multiple object list to m_o_l;
  45. if the number of keys in the key vault >= 5:
  46. say "You hear a creak as the tomb opens up...";
  47. end the game in victory.
  48. ]
  49.  
  50. test first with "put all on tomb".
  51. test second with "put keys on tomb".
  52. test third with "put all but silver key on tomb / put silver key on tomb".
Advertisement
Add Comment
Please, Sign In to add comment