Magic8Ball 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/magic8ball/answerator.rb +23 -3
- metadata +1 -1
@@ -2,19 +2,39 @@
|
|
2
2
|
class Answerator
|
3
3
|
|
4
4
|
def initialize
|
5
|
-
@answers = [
|
5
|
+
@answers = [
|
6
|
+
"It is certain",
|
7
|
+
"It is decidedly so",
|
8
|
+
"Without a doubt",
|
9
|
+
"Yes definitely",
|
10
|
+
"You may rely on it",
|
11
|
+
"As I see it, yes",
|
12
|
+
" Most likely",
|
13
|
+
"Outlook good",
|
14
|
+
"Yes",
|
15
|
+
"Signs point to yes",
|
16
|
+
"Reply hazy try again",
|
17
|
+
"Ask again later",
|
18
|
+
"Better not tell you now",
|
19
|
+
"Cannot predict now",
|
20
|
+
"Concentrate and ask again",
|
21
|
+
"Don't count on it",
|
22
|
+
"My reply is no",
|
23
|
+
"My sources say no",
|
24
|
+
"Outlook not so good",
|
25
|
+
"Very doubtful"]
|
6
26
|
end
|
7
27
|
|
8
28
|
# generate a answer for any question
|
9
29
|
#
|
10
30
|
# Example:
|
11
31
|
# >> obj.answer("Am I dumb?")
|
12
|
-
# =>
|
32
|
+
# => "My reply is no"
|
13
33
|
#
|
14
34
|
# Awguments:
|
15
35
|
# question: (String)
|
16
36
|
|
17
37
|
def answer(question)
|
18
|
-
question+" => "+@answers[rand(
|
38
|
+
question+" => "+@answers[rand(@answers.count)]
|
19
39
|
end
|
20
40
|
end
|