-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
43 lines (42 loc) · 1.04 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>
#include "./tic_tac_toe/tic_tac_toe.cpp"
#include "./rock_paper_scissors/rps.cpp"
int main()
{
std::cout << "This are the games I have made;" << std::endl;
std::cout << "\t1. Tic Tac Toe" << std::endl;
std::cout << "\t2. Rock, Paper, Scissors" << std::endl;
bool check;
do
{
std::cout << "Please enter the number of the game you want to play: ";
int game;
check = false;
std::cin >> game;
switch (game)
{
case 1:
ticTacToe();
break;
case 2:
rps();
break;
default:
std::cout << "Please enter a valid number" << std::endl;
check = true;
break;
}
} while (check);
std::cout << "Do you want to play another game? (y/n): ";
std::string play_again;
std::cin >> play_again;
if (validReply(toLower(play_again)))
{
main();
}
else
{
std::cout << "Thank you for playing" << std::endl;
return 0;
}
}