How can I break up this into variables?

Consider the following input. I have this.

Rooms:
foyer
snakepit
treasure room
mountain
crystal lake
elm street

Doors leaving foyer:
Mountain 5.3
elm street 20.84

Doors leaving snakepit:
treasure room 1.2
crystal lake 3.84
foyer 7.902

Doors leaving treasure room:
crystal lake 7.93

Doors leaving mountain:
foyer 53.3
elm street 17.38
crystal lake 133.4

Doors leaving crystal lake:
foyer 17.348

Doors leaving elm street:
snakepit 1335.5
treasure room 5.6
crystal lake 17.89
mountain 4.2

I want to organize it into my program so I can access them and use them as I see fit. For the Rooms: I want to have all lines read in from the file into my program and list all the rooms

For the doors leaving x room, I want to read in the room it can go to, and the number which could be a distance or amount of time it takes to get there. In this case, time to get there in minutes.

Considering that they always give my program a file formatted this way, what do you think is the best way for me to take this info in and store it so it will be like I asked for it in my program?
closed account (Dy7SLyTq)
make it a class
Well I do want to but what I mean is how can I sort this input into variables? I kinda get confused on how to take them in properly.
Well why don't you oragnise these descriptors into different sets. Then in your class you can have seperate lists (vectors perhaps) of strings for these descriptors...
Well the thing is, I would be I have trouble with the input. How exactly do I do these things. The rest I think i can handle.

How do I:
Read in something and not put it into memory like Rooms: but put the next things into room variables until I hit the white line, which I'm not sure how to tell the computer to stop inputting at that line.

How do I:
do the same for Doors leaving x but this time input room and the number for minutes.
Topic archived. No new replies allowed.