-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
53 lines (35 loc) · 1.1 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
44
45
46
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
int main(){
std::string options[] = {
"You are doing great",
"You are special. Your story isn't over yet",
"This day will be over soon. And tomorrow will be much easier",
"You are on your path. It's all just your path",
"You are enough",
"It could have been worse",
"You will figure it out",
"You've already done so much. Just think about it",
"Breathe",
"Take a walk",
"Take a rest",
"I believe in you. And I always have",
"It's okay to feel whatever you feel",
"Don't ever hesistate in yourself",
"Fuck them. The world is ours"
};
int size = sizeof(options) / sizeof(options[0]);
std::srand(std::time(0));
std::cout << "My name is Joi and I'm here for you. Just type my name followed by your concerns." << std::endl;
std::string userline;
while(true){
std::getline(std::cin, userline);
if(userline.find("Joi") == 0){
int randomIndex = std::rand()%size;
std::cout << options[randomIndex] << std::endl;
}
}
return 0;
}