The Supermarket is west of the Delicatessen Counter. Lugubrious Pete is in the Delicatessen. "Lugubrious Pete, dolefully slicing meats and cheeses, serves at the counter." Alice, Beth, Gemma, Delia, and Eliza are women in the Supermarket.
The deli queue is a list of objects that varies.
Two processes compete here: one that fills the queue, the other which will empty it. The first process is the one which brings shoppers in to the counter, joining the back of the queue, which is where "add … to …" puts new entries by default:
Every turn when a woman is in the Supermarket and a random chance of 2 in 3 succeeds (this is the customer arriving rule):
let the customer be a random woman in the Supermarket;
now the customer is in the Delicatessen;
if the player is in the Supermarket, say "[The customer] walks into the Delicatessen.";
if the player is in the Delicatessen, say "[The customer] comes in from the Supermarket, and [if the number of entries in the deli queue is 0]can't believe her luck. The counter is free![otherwise]resignedly queues behind [the deli queue].";
add the customer to the deli queue.
The competing process is the one which serves shoppers and thus gets rid of them again: unfortunately, it is slower. But Pete is fair if inefficient, and serves the customers in strict order of arrival. Each served customer is removed from the front of the list, and the others therefore all move up a place.
Every turn when the number of entries in the deli queue is not 0 and a random chance of 1 in 3 succeeds (this is the customer being served rule):
let the customer be entry 1 of the deli queue;
if the player is in the Delicatessen, say "Pete gives a droopy expression as he serves [customer], who nevertheless brightens and leaves.";
if the player is in the Supermarket, say "[customer] emerges cheerfully from the Delicatessen Counter, and goes about her regular shopping.";
now the customer is in the Supermarket;
remove entry 1 from the deli queue.
Instead of waiting in the Delicatessen when the number of entries in the deli queue is not 0, say "Time passes, for [deli queue] quite as much as for yourself."
Test me with "wait / wait / wait / east / wait / wait / wait / wait / wait".
Test me with "wait / wait / wait / east / wait / wait / wait / wait / wait".
Supermarket You can see Alice, Beth, Gemma, Delia and Eliza here.
>(Testing.)
>[1] wait Time passes.
Alice walks into the Delicatessen.
>[2] wait Time passes.
Beth walks into the Delicatessen.
Alice emerges cheerfully from the Delicatessen Counter, and goes about her regular shopping.
>[3] wait Time passes.
Delia walks into the Delicatessen.
Beth emerges cheerfully from the Delicatessen Counter, and goes about her regular shopping.
>[4] east
Delicatessen Counter Lugubrious Pete, dolefully slicing meats and cheeses, serves at the counter.
You can also see Delia here.
>[5] wait Time passes, for Delia quite as much as for yourself.
>[6] wait Time passes, for Delia quite as much as for yourself.
Alice comes in from the Supermarket, and resignedly queues behind Delia.
>[7] wait Time passes, for Delia and Alice quite as much as for yourself.
Eliza comes in from the Supermarket, and resignedly queues behind Delia and Alice.
Pete gives a droopy expression as he serves Delia, who nevertheless brightens and leaves.
>[8] wait Time passes, for Alice and Eliza quite as much as for yourself.
Gemma comes in from the Supermarket, and resignedly queues behind Alice and Eliza.
>[9] wait Time passes, for Alice, Eliza and Gemma quite as much as for yourself.
Beth comes in from the Supermarket, and resignedly queues behind Alice, Eliza and Gemma.
That completes the example, but here is a variation to show that queues need not empty from the front. The Deli already looks a pretty sexist establishment, with the customers all being women, but it is about to get a whole lot worse:
Modesty is a kind of value. The modesties are positively prim, buttoned up, modest, flirty, revealing and downright immodest. Every woman has a modesty. Alice is positively prim. Beth is downright immodest. Gemma is modest. Delia is flirty. Eliza is revealing.
We could then rewrite the service rule like so:
Every turn when the number of entries in the deli queue is not 0 and a random chance of 1 in 3 succeeds (this is the customer being served rule):
let Pete's preference be the deli queue;
sort Pete's preference in reverse modesty order;
let the customer be entry 1 of Pete's preference;
let the first in line be entry 1 of the deli queue;
if the player is in the Delicatessen, say "[if the customer is the first in line]Pete gives a droopy expression as he serves [the customer], who nevertheless brightens and leaves.[otherwise]Outrageously, Pete scans the queue, notices [the customer] in her [modesty of the customer] clothes, and serves her next, while [the first in line] glares at him.";
if the player is in the Supermarket, say "[The customer] emerges cheerfully from the Delicatessen Counter, and goes about her regular shopping.";
now the customer is in the Supermarket;
remove the customer from the deli queue.
It is now heartbreakingly difficult for Alice to obtain her sliced chorizo sausage.