Can't get this to work...roadblock....help?!? I am new to this and am trying to write game code for a C++ course at Delco CC. Any help would be appreciated greatly. When it runs it will not loop as intented and thus I'm stuck from moving forward in coding the rest of my game.
cout<<"What space is your map in?"<<endl;
cin>> space;
if (space == 4||8)
{
cout<<"Nope! There's nothing in here."<<endl;
return findMap;
}
if (space == 5||6)
{
cout<<"Tough luck, you only found blank map paper. It's
useless."<<endl
return findMap;
}
if (space == 1||7)
{
cout<<"You found poision gas. You failed."<<endl;
return 0;
}
if (space == 1)
{
cout<<"Yippie! You found your map!"<<endl;
}
if (space == 9)
{
cout<<"Well, you found your wallet..."<<endl;
return findMap;
}
}
int game(findMap)
{
string name;
int findMap;
cout<<"It appears that you have been lost at sea."<<endl;
cout<<"But don't worry, you'll only have to survive until you reach
land, for this round."<<endl;
cout<<"Anyways, why don't you tell me your name?"<<endl;
cin>> name;
cout<<"Well, "<< name<<", do yourself a favour and find your
map..."<<endl;
cout<<findMap<<endl;
}
if(space == 1||4) // this is incorrect
if(space == 1 || space == 4) // this is correct
The code definitely won't compile as is, you need to step through the errors and fix them, then repost the fixed code using code tags. (<> icon to the right of the composition box)