#include <stdio.h>
#include <string.h>

typedef struct TRoom
{
    char desc[256];
    struct TRoom *north;
    struct TRoom *south;
} Room;

int main()
{
    Room northRoom, southRoom;
    Room *currentRoom;
    int c;

    strcpy(northRoom.desc, "This is the north room");
    northRoom.north = NULL;
    northRoom.south = &southRoom;
    strcpy(southRoom.desc, "This is the south room");
    southRoom.north = &northRoom;
    southRoom.south = NULL;
    
    currentRoom = &northRoom;

    printf("n: north, s: south, q: quit\n");

    do
    {
        Room *nextRoom = currentRoom;
        printf("%s\n", currentRoom->desc);

        c = getchar();
        switch (c)
        {
            case 'n':
                nextRoom = currentRoom->north;
                break;
            case 's':
                nextRoom = currentRoom->south;
                break;
        }

        if (nextRoom == NULL)
        {
            printf("Can't go there\n");
        }
        else
        {
            currentRoom = nextRoom;
        }
    } while (c != 'q');
    
    return 0;
}