THE PROGRAMME WORKS BUT WHEN IT SAYS "Press '1' to Play Again or '0' to Exit"
it does not work correctly(IT DOES NOT QUITS). PLEASE HELP????????!!!!!!! THE CODE IS:-
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <cstdlib>
#include <ctime>
#include <string>
using namespace std;
int main()
{
system("title ODD-EVE GAME");
system("color B0");
string path;
cout<< "WELCOME TO ODD-EVE GAME!!!!!" <<endl <<endl;
cout<<"PLEASE CHOOSE YOUR PATH - ODD OR EVE: ";
cin>> path;
system("cls");
if(path=="eve" || path=="EVE" || path=="Eve"|| path=="eVe" || path=="EvE" || path=="eVE"|| path=="EVe")
{
int num;
srand(time(0));
int j;
j = 1 + (rand()%6);
cout<< "Let's Play ODD-EVE!(YOU ARE EVE) "<<endl <<endl;
Sleep(1000);
cout<< "Enter a number between 1 to 6: ";
cin>> num;
cout<< "Press '1' to Play Again or '0' to Exit :";
cin>> pick;
if (pick == '1')
{
system("cls");
main();
}
if (pick == '0')
{
MessageBox(0,"Thank You For Playing!\n MADE BY-KANISHK JAYANT LAL","MESSAGE!", MB_OK);
return 0;
}
}
if(j<num)
{
int result;
int pick;
result = num - j;
if(result==1 || result==3 || result==5)
{
cout<< "You Lose!" <<endl;
}
if(result==2 || result==4)
{
cout<< "You Win!" <<endl <<endl;
}
cout<< "Press '1' to Play Again or '0' to Exit :";
cin>> pick;
if (pick == '1')
{
system("cls");
main();
}
if (pick == '0')
{
MessageBox(0,"Thank You For Playing!\n MADE BY-KANISHK JAYANT LAL","MESSAGE!", MB_OK);
return 0;
}
}
if(num==j)
{
cout<<"You Win!" <<endl <<endl;
}
int pick;
cout<< "Press '1' to Play Again or '0' to Exit :";
cin>> pick;
if (pick == '1')
{
system("cls");
main();
}
if (pick == '0')
{
MessageBox(0,"Thank You For Playing!\n MADE BY-KANISHK JAYANT LAL","MESSAGE!", MB_OK);
return 0;
}
cout<< "Press '1' to Play Again or '0' to Exit :";
cin>> pick;
if (pick == '1')
{
system("cls");
main();
}
if (pick == '0')
{
MessageBox(0,"Thank You For Playing!\n MADE BY-KANISHK JAYANT LAL","MESSAGE!", MB_OK);
return 0;
}
}
if(j<num)
{
int result;
int pick;
result = num - j;
if(result==1 || result==3 || result==5)
{
cout<< "You Win!" <<endl;
}
if(result==2 || result==4)
{
cout<< "You Lose!" <<endl <<endl;
}
cout<< "Press '1' to Play Again or '0' to Exit :";
cin>> pick;
if (pick == '1')
{
system("cls");
main();
}
if (pick == '0')
{
MessageBox(0,"Thank You For Playing!\n MADE BY-KANISHK JAYANT LAL","MESSAGE!", MB_OK);
return 0;
}
}
if(num==j)
{
cout<<"You Lose!" <<endl <<endl;
}
int pick;
cout<< "Press '1' to Play Again or '0' to Exit :";
cin>> pick;
if (pick == '1')
{
system("cls");
main();
}
if (pick == '0')
{
MessageBox(0,"Thank You For Playing!\n MADE BY-KANISHK JAYANT LAL","MESSAGE!", MB_OK);
return 0;
}