-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
80 lines (76 loc) · 1.91 KB
/
index.php
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
<?php
function magic8Ball()
{
echo "Tell me... What is your question?\n";
$question = readline(">> ");
echo "\nHmm I see... Your question is $question... I understand why this weighs on you... I have consulted the spirit world.\nHere is your answer: ";
$choice = rand(0, 19);
//echo $choice;
switch ($choice) {
case 0:
echo "It is certain.\n";
break;
case 1:
echo "It is decidedly so.\n";
break;
case 2:
echo "Without a doubt.\n";
break;
case 3:
echo "Yes - definitely.\n";
break;
case 4:
echo "You may rely on it.\n";
break;
case 5:
echo "As I see it, yes.\n";
break;
case 6:
echo "Most likely.\n";
break;
case 7:
echo "Outlook good.\n";
break;
case 8:
echo "Yes.\n";
break;
case 9:
echo "Signs point to yes.\n";
break;
case 10:
echo "Reply hazy, try again.\n";
break;
case 11:
echo "Ask again later.\n";
break;
case 12:
echo "Better not tell you now.\n";
break;
case 13:
echo "Cannot predict now.\n";
break;
case 14:
echo "Concentrate and ask again.\n";
break;
case 15:
echo "Don't count on it.\n";
break;
case 16:
echo "Don't count on it.\n";
break;
case 17:
echo "My reply is no.\n";
break;
case 18:
echo "My sources say no.\n";
break;
case 19:
echo "Outlook not so good.\n";
break;
case 20:
echo "Very doubtful.\n";
}
}
magic8Ball();
magic8Ball();
magic8Ball();