unsigned char map[100][100];
This is your map.
#define HAS_MONSTER 1
#define HAS_ITEM 2
#define HAS_OBJECT 4
#define HAS_STAIRS 8
These are your flags.
struct thing { struct thing *next; /* other fields */ };
struct thing *monsters, *items, *objects, *stairs;
These are your linked lists which actually contain interesting things.
Drawing the map is easy; simply scan the map[][]
array and then fill in the blanks.
Pathfinding is easy; only map[][]
needs to be consulted.