An interactive fiction by Juhana Leinonen (2008) - the Inform 7 source text
|Part Inserting stuff
To decide whether (insertee - a thing) is too large to insert:
if the insertee is:
-- the encyclopedia:
-- the whiskey bottle:
if the insertee is bulky:
Before inserting something into a normal-sized container when the noun is too large to insert:
say "It doesn't fit." instead.
[the next rule is crafted basically to make it work so that if you try to put something in the drinking glass when there's a container (i.e. the tin foil) inside it, instead of getting a "no more room" message, it just puts the thing inside the other container.]
Before inserting something into a container (called the original box):
if a container is in the original box and the carrying capacity of the original box is 1:
let the inner box be a random container in the original box;
say "([the inner box])[command clarification break]";
try inserting the noun into the inner box instead;
continue the action.