Source symbols:
a map area = 1159
B map loop macro
C m(i)
d keys
e gold
f level
G player move macro
H item check macro
i iterator
j i\wide
k i mod mapwidth
L m(p)
m map
N and
o map sight mask
p generic variable (set by S macro)
q pause time count down / macro arg
R rnd / macro arg
RM sight macro
S find tile mac / macro arg
T if
U mod
v generic variable (set by T macro)
W define
x location of downstairs item
y player health
z player position

On maps with lvl%3 = 0, the stairs are in a certain chest
On maps with lvl%3 = 1, a certain switch will create the stairs
On maps with lvl%3 = 2, the stairs are out in the open

The numbers referring to each item in the m array, along with the
chance that any non wall/door tile on the map is generated as:
0 floor          81%
1 -
2 mapping scroll 0.80%
  1/3 chance to reveal the map
  1/3 chance to hide the map
  1/3 chance to reveal the location of the downstairs item
3 pause portal   0.46%
4 teleport       0.79%
5 locked door 
6 door
7 key            2.75%
8 enemy          9.78%
9 wall
10 @
11 chest         0.40%
  1/6 chance to contain each of mapping scroll, pause portal,
  hp, switch, gold, teleport
12 hp            2.40%
13 switch        0.80%
  1/14 chance to do nothing
  1/7 chance to turn 50% of mapping scrolls into pause portals
  1/7 chance to turn 50% of pause portals into teleporrts
  1/7 chance to turn 50% of teleports into locked doors
  1/7 chance to turn 50% of locked doors into doors
  1/7 chance to turn 50% of doors into keys
  1/7 chance to turn 50% of keys into enemies
  1/14 chance to turn 50% of enemies into stone
14 gold          0.46%
15 stairs