Programing assingment

i have a program for a room map game. the game you read the file in from a games.txt and it tells you how many room here are, and which rooms you can enter from the room you selected. you select which room you can enter by typing a u,d,l,or r. forum down left and right. then you have to print your results on how many time you went up down left and right to a txt file called bread crumb. I have to use functions with this and i am having trouble getting my code to work. please don't judge i am new to functions so they are confusing for me.


#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;

int Getnumroom(){
int totalrooms;
ifstream infile;
infile.open ("GameFile.txt");
infile >> totalrooms;
cout << "there are 1-" << totalrooms << endl;
}

int startroom(int total, int croom){
cout << "what room would you like to start in?" << endl;
cin >> croom;
Getnumrooms();
if (croom < total || croom > total){
cout << "invalid room" << endl;
croom = 1;
}

void fileprocess(int temp, int val, char& drooms) {

infile.open("GameFile.txt");
while (drooms !='z'){
int counter = 0;
infile >> temp;
val = (drooms -1)* 4;
}
if (counter < val){
counter++;
}
infile >> u >> endl;
infile >> d >> endl;
infile >> l >> endl;
infile >> r >> endl;

}

int inputfunction(char droom){

cout<<"From here you may choose from the following options:"<<endl;
cout<<"Up: "<<u<<endl;
cout<<"Down: "<<d<<endl;
cout<<"Left: "<<l<<endl;
cout<<"Right: "<<r<<endl;
cout<<"Make your selection by typing u, d, l, or r. (type z to quit) "<<endl;
cin >> droom >> endl;
fileprocess();
}

void updatestate(){
ofstram outfile;
outfile.open("creadcrumb.txt");
switch(drooms){
case 'u':
outFile << "Up to room: " << u << endl;
break;
case 'd':
outFile << "Down to room: " << d << endl;
break;
case 'l':
outFile << "Left to room: " << l << endl;
break;
case 'r':
outFile << "Right to room: " << r << endl;
break;
}


switch(dSelect){
case 'u':
rooms = u;
break;
case 'd':
rooms = d;
break;
case 'l':
rooms = l;
break;
case 'r':
rooms = r;
break;
}

}


int main(){
int rooms;
Getnumroom();
startroom();
fileprocess);
inputfunction();
updatestate();

return 0;
}
Firstly, you don't appear to be having return values for your functions.
Topic archived. No new replies allowed.