Conditional description based on direction

I have a room that should display a different description depending on which way the player has entered, but I can’t figure out the condition to use to accomplish this.

For example, when the player enters from the west it might say “You see a castle in front of you.” When the player enters from the east it might say “You are leaving the castle behind you.”

Include this code:

[code]The most recent direction of travel is a direction that varies. To decide whether we have/-- entered from (way - a direction): decide on whether or not the most recent direction of travel is the way.

After going: now the most recent direction of travel is the noun; make no decision.[/code]

Now you can check whether “we entered from the north” or whatever.