bool's they both are stated as an area in game.What i want to do is make
a search function, so i can search what's inside of differnt area's.
Im not sure how to go about this. Here's some code so you
can check it out an see where im trying to
go with it.
sorry for not using the code tags, but it's not working right or im not getting it right.
#include <iostream>
#include <string>
#include <cstdlib>
#include <time.h>
#include <vector>
using namespace std;
bool A1();
bool A2();
void search();
string direction;
int main()
{
A1();
A2();
system("pause");
}
bool A1()
{
while (NULL != 4)
{
cout << "Your in a cold dungeon\n";
cout << "> ";
cin >> direction;
cin.clear();
cin.ignore(INT_MAX,'\n');
cout << endl;
if (direction == ("north"))
{
cout << "you follow the path north of you\n\n";
return 0;
}
if (direction == ("south"))
{
cout << "theres a rock blocking the path\n\n";
search();
}
if (direction == ("back"))
{
return false;
}
}
}
bool A2()
{
while (NULL != 4)
{
cout << "you come to a intersection\n";
cout << "> ";
cin >> direction;
cin.clear();
cout << endl;
if (direction == ("north"))
{
cout << "Wall\n";
search();
}
if (direction == ("south"))
{
cout << "you seel a small hole, that you could crawl throu\n";
A1();
}
if (direction == ("back"))
{
return false;
}
}
}
void search()
{
srand((unsigned)time(0));
vector<string> areas;
areas.push_back("dark\n");
areas.push_back("light\n");
int areas_number = rand()%areas.size();
if(&A1)
{
cout << areas[areas_number];
}
else if(&A2)
{
cout << areas[areas_number];
}
}