👉 A library is a GnollHack special room with bookshelves, spellbooks and scrolls, guarded by one of four groups of monsters.

Libraries are generated at random from dungeon level 8 down. The floor is parquet. One square in five has a bookshelf, and of the other squares, one in five has a spellbook or a scroll lying on it (one in four from level 12 down). About a quarter of these are spellbooks, which makes a library worth finding for a spellcaster.

Each square has a 1 in 2 chance of a monster, so about half the room is occupied. The group depends on the depth:

Dungeon Level Group
8–9 Gnomish wizards or gnoll wardens, equally likely
10–12 Liches (1 in 2), gnomish wizards (1 in 4) or gnoll wardens (1 in 4)
13 and deeper Liches (3 in 4) or tentacled ones (1 in 4)

The monster in the middle of the room, if there is one, leads the group: a gnoll supreme warden for the gnoll wardens, and a demilich instead of a lich for the liches from level 13 down. A lich group is mostly imps and quasits, with some liches among them. Tentacled ones are GnollHack's mind flayers.