Directions

D[exit number]
[exit description, (*optional*)]
~
[keyword list]~
[Door flag][key number][to_room]{[trap fields]}
[Exit number] is one of:

0 = North 1 = East 2 = South
3 = West 4 = Up 5 = Down

[exit description]

Now optional and are currently not visible thanks to the new "scan" command.

[keyword list]~

used for commands like open and close. Should be 'door' for ordinary doors but can have multiple entries, like door, secret, entrance, trapdoor all separated by spaces...see example above.

[Door flag]

If it is 0, there is no door leading that way, just a passageway
If it is 1, the exit can be opened/closed only
If it is 2, the exit can be locked/unlocked/opened/closed/picked w/ lockpick
If it is 3, then same as 2, but un-pickable/un-doorbashable

If it is a secret door, then add the value 4 to it, this will cause
the search command to be required before the door can be found.

If it is a blocked exit, then add the value 8 to it. A switch item will
be needed to open the exit; ask a god for help if you wish to make
blocked exits.

If it is a trapped exit, then add the value 16 to it.

The state of the doors after reset may be controlled by a command in the
reset-command table (see the zone file). The default state of a door is
open (0).

[Key Number]

The number of the object which can unlock/lock the door. If [Door flag] is 0, the value of this field is ignored. To make the door magical and open only when a special word is spoken (like the magic gate east of WD), make this field -2. The last word in the door [keyword list] will be the triggering word.

[to_room]

The virtual number of the room to which the exit leads.