Room c++ programing game

need help with a program that read in from a file. the program is for a room game. there are 15 rooms and when you enter a room you can only access certain rooms from there. in the file it tells you what those rooms are in the order of up, down, left, and right. i need help with how you assign each line to a room and the each column to a letter. to access another room you either press u,d,l,or r. the first line is the number of rooms which is 15. and after that is the rooms 1-15 but technically 2-16. this program also tells you the amount of rooms you can enter from there. this is all the code i have so far. it is reading all the lines in i did a cout statement to make sure.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 #include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
char room;
int room1;
string line;  
ifstream infile;
infile.open("GameFile.txt");
while (! infile.eof()){
getline(infile,line);
cout << line << endl;

}



return 0;
}
Are you asking what your GameFile.txt should look like ?

Topic archived. No new replies allowed.