-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMagicEightBall.cpp
81 lines (75 loc) · 1.76 KB
/
MagicEightBall.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
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <ctime>
int main()
{
cout << "Welcome to the Magic 8 Ball, where all your questions may be answered." << std::endl;
cout << "What would you like to know the answer to? Type your question here." << std::endl;
std::string user_input;
cin >> user_input;
cout << "This is what the Magic 8 Ball has to say..." << std::endl;
int result = (rand() % 20) + 1;
switch(result){
case 1:
cout << "It is certain." << std::endl;
break;
case 2:
cout << "It is decidedly so." << std::endl;
break;
case 3:
cout << "Without a doubt." << std::endl;
break;
case 4:
cout << "Yes - definately." << std::endl;
break;
case 5:
cout << "You may rely on it." << std::endl;
break;
case 6:
cout << "As I see it, yes." << std::endl;
break;
case 7:
cout << "Most likely." << std::endl;
break;
case 8:
cout << "Outlook good." << std::endl;
break;
case 9:
cout << "Yes." << std::endl;
break;
case 10:
cout << "Signs point to yes." << std::endl;
break;
case 11:
cout << "Reply hazy, try again." << std::endl;
break;
case 12:
cout << "Ask again later." << std::endl;
break;
case 13:
cout << "Better not tell you now." << std::endl;
break;
case 14:
cout << "Cannot predict now." << std::endl;
break;
case 15:
cout << "Concentrate and ask again." << std::endl;
break;
case 16:
cout << "Don't count on it." << std::endl;
break;
case 17:
cout << "My reply is no." << std::endl;
break;
case 18:
cout << "My sources say no." << std::endl;
break;
case 19:
cout << "Outlook not so good." << std::endl;
break;
case 20:
cout << "Very doubtful." << std::endl;
break;
}
}