#include "stdafx.h"
#include<iostream>
#include<string>
#include<sstream>
#include<fstream>
usingnamespace std;
int main()
{
int a;
int b;
cout<<"You find yourseelf in a small village, you hear the sound of birds chirping in the distance."<< endl;
cout<<"There are paths leading in all directions yet two of them are blocked by local guards." << endl;
cout<<"type 2 for north or 4 for west"<< endl;
cin>> a;
if (a = 2)
{
cout<<"You bump into a freindly villager, the villager was kind and asked if you wanted some resorces to get started with your expedition."<< endl;
cout<<"Take the resorces?"<< endl;
cout<<"type 1 for yes and 2 for no";
}
cin.get();
return 0;
}
Also if (a = 2) is incorrect, replace it by if (a == 2)
This is because "=" is the assignment operator, and it gives a the value of 2. For comparisons you have to use "==".
Just in case you didn't know, you can change int a; int b; into int a, b;