-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cc
More file actions
78 lines (60 loc) · 1.68 KB
/
Copy pathmain.cc
File metadata and controls
78 lines (60 loc) · 1.68 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "mastermind.h"
#include <iostream>
#include <cstdlib>
#include <string>
#include "riddles.h"
using namespace std;
int main() {
string i;
int wrong = 0;
int guesses = 0;
cout << "\u001b[40;1m\u001b[37;1mEnter password:" << endl;
while (cin >> i){
++ guesses;
// number to match
if (i == "1047"){
break;
} else {
cout << "\u001b[1A\u001b[2K";
++ wrong;
cout << "This is not the password!" << endl;
}
if (wrong >= 4 && (wrong % 4 == 0)){
cout << "Time is ticking!" << endl;
}
}
while (guesses >= -1){
cout << "\u001b[1A\u001b[2K \u001b[1A\u001b[2K ";
--guesses;
}
cout << endl << endl << endl << endl << "\u001b[42mCorrect!\u001b[40;1m" << endl;
Riddles r;
cout << endl;
Mastermind mm;
mm.playGame();
cout << endl << endl;
cout << endl << endl;
cout << " \u001b[35;1m UULL" << endl;
cout << endl << endl;
cout << " - .. . ... \u001b[37;1m" << endl;
cout << endl << endl;
cout << "Please enter Poke-password:" << endl;
guesses = 0;
while (cin >> i){
++ guesses;
if (i == "help"){
cout << endl << endl;
break;
}
else {
cout << "that is not the password" << endl;
}
}
while (guesses >= -10){
cout << "\u001b[1A\u001b[2K \u001b[1A\u001b[2K ";
--guesses;
}
cout << endl << endl << endl << endl << endl << endl << endl << "\u001b[35mCongratulations for helping the professors!" << endl;
cout << endl << endl << endl;
return 0;
}