#include <iostream>
#include <string>
#include <ctime>
using namespace std;
void menu();
void p_c();
void menu2();
int main()
{
int navigator=0,navigator_2=0;
string game_name;
char end_option;
menu();
while (1)
{
cin >> navigator;
system("cls");
switch (navigator)
{
case 1:
cout << "WELCOME IN C++ CASINO."; break;
case 2:
cout << "WELCOME BACK IN C++ CASINO." << endl;
cout << "Your game name - " << game_name << "." << endl; break;
case 3:
menu2();
while (1)
{
cin >> navigator_2;
system("cls");
switch (navigator_2)
{
case 1:
case 2:
case 3:menu(); break;
default:
cout << "THIS OPTION DOESN'T EXIST!" << endl;
cout << "Try one more time" << endl;
p_c();
menu2(); break;
}
}
case 4:
while (1)
{
cout << "DO YOU REALLY WANT TO LEAVE THE CASINO?" << endl;
cout << "Choose Y/N: ";
cin >> end_option;
if (end_option == 'Y' || end_option == 'y')
{
cout << "SEE YOU SOON." << endl;
system("PAUSE");
exit(0);
}
if (end_option == 'N' || end_option == 'n')
{
cout << "So, let's go back to the main menu." << endl;
p_c();
menu(); break;
}
else
{
cout << "THIS OPTION DOESN'T EXIST!" << endl;
cout << "Try one more time" << endl;
p_c();
}
}
default:
cout << "THIS OPTION DOESN'T EXIST!" << endl;
cout << "Try one more time" << endl;
p_c();
menu(); break;
}
}
system("PAUSE");
}
void menu()
{
cout << "ROULETTE GAME" << endl;
cout << "=============" << endl;
cout << "<<MAIN MENU>>" << endl;
cout << "=============" << endl;
cout << "1.Start a new game." << endl;
cout << "2.Continue the game." << endl;
cout << "3.Game rules." << endl;
cout << "4.END." << endl;
cout << "Enter: ";
}
void p_c()
{
system("PAUSE");
system("cls");
}
void menu2()
{
cout << "WELCOME IN RULE SECTION." << endl;
cout << "1.Chance to win." << endl;
cout << "2.How much I can win." << endl;
cout << "3.Go back to menu." << endl;
cout << "Enter: ";
}
Pomoże ktoś wyjść z menu w case 3 do głównego menu?