-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (41 loc) · 965 Bytes
/
main.cpp
File metadata and controls
50 lines (41 loc) · 965 Bytes
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
44
45
46
47
48
49
50
#include "hangman.h"
int main() {
int mode = 1;
printTitle();
selectMode(mode);
while (mode <= 3) {
if (mode == 1) {
cout << "* * * S I N G L E M O D E * * *" << endl;
ifstream list;
string ans, copy, underbar, letter;
string guess = " ";
int count = 0;
list.open("list.txt");
srand(time(NULL));
int r = rand() % LINE + 1;
for (int i = 0; i < r; i++)
list >> ans;
toUpper(ans);
playHangMan(ans, copy, underbar, letter, guess, count, mode);
}
else if (mode == 2) {
cout << "* * * D U A L M O D E * * *" << endl;
string ans, copy, underbar, letter;
string guess = " ";
int count = 0;
cout << "Enter a word for other player to guess: ";
cin >> ans;
toUpper(ans);
system("clear");
playHangMan(ans, copy, underbar, letter, guess, count, mode);
}
else if (mode == 3) {
cout << "See you later!" << endl;
break;
}
else {
selectMode(mode);
}
}
return 0;
}