This implements a queue of people waiting to be served at a counter.
"Q" by "Wesley Werner" There is a room called Ground Up. "A quaint place" [ THE DRINK ] Some coffee is carried by the waitress. The description is "Black gold." Some candy is carried by the waitress. It is edible. [ SEE http://inform7.com/learn/man/RB_10_2.html for more on drinking ] The block drinking rule is not listed in the check drinking rulebook. Check drinking coffee: if the coffee is not carried by the player, say "You don't have any coffee yet." instead. Report drinking coffee: say "Mmm delicious."; A enterable container called the queue is in Ground Up. Understand "line" as the queue. [ REMOVE PRINTING CONTENTS OF OPEN CONTAINERS ] [ IN OUR CASE: DO NOT LIST PATRONS IN THE QUEUE ] Rule for printing room description details: stop. [ PATRONS ] A patron is a kind of person. The description is "They are waiting patiently." There are three patrons in the queue. [ WAITRESS ] A waitress is a woman. [ SEE http://inform7.com/learn/man/RB_7_4.html for more on this rule ] The block giving rule is not listed in the check giving it to rules. [ PERSUADE HER TO GIVE THE COFFEE, OTHERWISE YOU GET "The waitress has better things to do." ] Persuasion rule for asking a waitress to try giving the coffee to the player: persuasion succeeds; [ KISS PATRONS TO GET THEM OUT OF THE QUEUE ] Instead of kissing a patron (called the intended victim): now the intended victim is nowhere; let n be the number of patrons in the queue; if n is zero: say "The last person leaves, it's your turn to order."; move a waitress to Ground Up; else: say "A person leaves the queue, [n in words] remain."; stop the action; [ YOU CAN LOSE YOUR SPOT IN THE QUEUE ] Every turn (this is the patrons filling up the queue rule): if the number of patrons in the queue is less than 3 and the player is not in the queue: [ recall a patron from the nether ] let a chosen patron be a random patron not in the queue; move a chosen patron to the queue; say "Someone joins the queue. You lost your spot!"; Test me with "get in the queue/kiss a patron/out/enter queue/kiss a patron/again/again/look/ask waitress for coffee/take inventory/drink coffee"