Currently I am trying to create a little text based dungeon crawler in C where the map should be randomly generated. I try to accomplish this by using a quad-linked list, where every node(room) can have up to four connections to next rooms.
typedef struct Room {
int x; //each room got its own number to be identified.
struct Room *north;
struct Room *east;
struct Room *south;
struct Room *west; } room;
It should also be possible for some rooms to have only one or two or three connections while the unused pointers to next nodes remains NULL. For varius reasons I need a search algorithm which iterates through the rooms to find a specific one. I have no idea how to implement something like this. Any ideas?