@Wo1ves1n0/

FAULTY

C++

No description

fork
loading
Files
  • main.cpp
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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#include <iostream> // libary 
#include <string>// libary
#include <cstdlib>// libary
#include <ctime>// libary

using namespace std; // text short code.


int main() { //main start 
////////////////////////////////////////////////////////////////////////////////////////////////////
cout << "Hello! Welcome to my game \"JailBreak!\" " << endl; //Intro
cout << " " << endl; //Space

cout << "NNNNNNNNNNmyhNNNNNNNNNNNdshNNNNNNNNNNNdyhNNNNNNNNN " << endl; //Image 1

cout << "MMMMMMMMMMmddMMMMMMMMMMMmhyMMMMMMMMMMMmdhMMMMMMMMM" << endl; //Image 2

cout << "MMMMMMMMMMmhdMMMMMMMMMMMdyyMMMMMMMMMMMdhhMMMMMMMMM " << endl; //Image 3

cout << "MMMMMMMMMMdsdMMMMMMMMMMMdysMMMMMMMMMMMdysMMMMMMMMM " << endl; //Image 4

cout << "MMMMMMMMMNhsdNNMMMMMMMMMdssMMMMMMMMNNNdysNNNMMMMMM" << endl; //Image 5

cout << "MMMMMMhsoo+//:/+omMMMMMMdyyMMMMMMNs+++/::///sMMMMM" << endl; // Image 6

cout << "MMMMMmo+osso+++/-yMMMMMMhssMMMMMMmshyo++/:::-mMMMM" << endl; //Image 7 

cout << "MMMMMds+++oo+++hhhMMMMMMhsyMMMMMMNNyssoo++o+shMMMM" << endl; //Image 8 

cout << "MMMMMMy++oo++++dMMMMMMMMmsyMMMMMMMMhyso++oo+ooMMMM" << endl; //Image 9

cout << "MMMMMMNysssooosNMMMMMMMMNhhMMMMMMMMMmdysyysohdMMMM" << endl; //Image 10

cout << "MMMMMMMNNNNmNNNMMMMMMMMMmdhMMMMMMMMMMMNNNNNNMMMMMM" << endl; //Image 11

cout << "MMMMMMMMMMNmmMMMMMMMMMMMmddMMMMMMMMMMMmdmMMMMMMMMM" << endl; //Image 12

cout << "MMMMMMMMMMNdhMMMMMMMMMMMNmmMMMMMMMMMMMMmmMMMMMMMMM" << endl; //Image 13

cout << "MMMMMMMMMMNmNMMMMMMMMMMMMmdMMMMMMMMMMMMNmMMMMMMMMM" << endl; //Image 14

cout << "MMMMMMMMMMMNNMMMMMMMMMMMNmmMMMMMMMMMMMMmmMMMMMMMMM" << endl;


cout << " " << endl; //Space

cout << " " << endl; //Space:Extra 
////////////////////////////////////////////////////////////////////////////////////////////////////
cout << "MMMMNho/-.`   `.:odMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" << endl; //Image 1

cout << "MNs-   `:oydNMMNs  :MMMMMMMMMMh:.oMMMMMMMMMMMMMMMM" << endl; //Image 2

cout << "h.   /hMN-/dMMMMm   MMMMMMMMN/  --MMMMMMMMMMMMMMMM" << endl; //Image 3

cout << "`  -mMMM/  /MMMN-  yMMMMMMMN- `s`yMMMMMMMMMMMMMMMM" << endl; //Image 4

cout << "/ .MhdMh  `NMNo` -dMMMMMMMM/  +.oMMMMMMMMd/:yMMMMM" << endl; //Image 5

cout << "MmmMm./.  ./- `/hm.-dM+-+Md   :dMMy/...+d   yMMMMM" << endl; //Image 6

cout << "MMMMMM+    -ydMMM/  dm  -M+  dMMh. `sNh +  .mMMMdo" << endl; //Image 7

cout << "MMMMMM:  .  yMMMh  /N-  dd` .MMh  .mdo.+y`  `mMs`y" << endl; //Image 8 

cout << "MMMMMN   d+  yMM: `d-  :h`. -MN-  -/ohd:.h+  .-+NM" << endl; //Image 9

cout << "MMMMMd  `MM/  oMy ``s: `.dm. -`:` -o/-/ys`  `sMMMM" << endl; //Image 10

cout << "MMMMMN+--MMM+  -mNdNMMmmMMMMmdNMMmddmMMMNddmMMMMMM" << endl; //Image 11

cout << "MMMMMMMMMMMMMy`  +NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" << endl; //Image 12

cout << "MMMMMMMMMMMMMMN+`  :smMMMMNhMMMMMMMMMMMMMMMMMMMMMM" << endl; //Image 13

cout << "MMMMMMMMMMMMMMMMNy/-`  .:/odMMMMMMMMMMMMMMMMMMMMMM" << endl; //Image 14 

cout << " " << endl; //Space

////////////////////////////////////////////////////////////////////////////////////////////////////


cout << "I'm going to explain the rules for the game first..." << endl;

cout << "You! are going to be the Jailer! and the computer will be the escapee" << endl; //Roles
cout << " " << endl; //Space

cout << "As a jailer, you will need to set a 3 digit for the escapee(computer) to guess!" << endl; //Rule 1
cout << " " << endl; //Space

cout << "If the escapee enters the code right then game over! However, if the escapee didn't guess the right answer then the game will continue until the escapee gets it right." << endl; // rule 2
cout << " " << endl; //Space

cout << "you can only set the digits between 001 - 100" << endl; // rule 3
cout << " " << endl; //Space

cout << "Let's start! have fun and enjoy!(p.s you can always quit! 'q' 'Q' 'quit' 'QUIT') " << endl; //Starting game
cout << " " << endl; //Space
////////////////////////////////////////////////////////////////////////////////////////////////////
cout << "Are you ready to start the game of jailBreak?" << endl; // Asking for the player to start the game.

string userInp;
cin >> userInp;

if (userInp == "yes") // if user types yes question
{
  cout << "Starting game..." << endl; //Stating the adventure for the player. 

cout << "" << endl;//Space

} // end of question

////////////////////////////////////////////////////////////////////////////////////////////////////
else if (userInp == "no") // If the player types no ends adventure. 

{ //Start of NO
  cout << "Ending game! See you next time!" << endl;

} //end of NO 

cout << "" << endl;//Space

////////////////////////////////////////////////////////////////////////////////////////////////////

cout << "\033[2J"; //clears the screen at the beginning of the game

cout << "Oh no! One of the escapee's has tried to run! Quick set a code to the Lock! " << endl; // Start of the game
cout << " " << endl;

////////////////////////////////////////////////////////////////////////////////////////////////////

srand(static_cast<unsigned int>(time(0)));
int escapee = rand() % 100 + 1; // random guess percentage
int low = 1; // range number low
int high = 100; // range number high
int jailerNum; //Users number

do
{
  jailerNum = 0;
  cout << "Enter code here: (1 - 100) " << endl;
  cin >> jailerNum; 
} while (jailerNum < 1 || jailerNum > 100); //Input Number

while (escapee != jailerNum)
{
  if (jailerNum < escapee)
  {
    cout << "Let's try  " << escapee << "(too high!)" << endl;
    high = escapee;
    escapee = (escapee + low - 1) / 2;
  }
  else 
  {
      cout << "Let's try  " << escapee << "(too low!)" << endl;
      escapee = (escapee + high + 1) / 2;
  }
  cout << " I guessed  " << escapee << endl;
}

////////////////////////////////////////////////////////////////////////////////////////////////////


return 0;
} //main end