-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathWorrying.rb
More file actions
28 lines (24 loc) · 712 Bytes
/
Worrying.rb
File metadata and controls
28 lines (24 loc) · 712 Bytes
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
=begin
You are worried about the outcome of something major, e.g. a test or a job
application. The input will be a string and your task is to return "Stop
worrying, everything will be all right!" in the following conditions:
"Making last-minute changes"
"Sitting in a dark room and shaking"
"Crying"
"Laughing hysterically"
"Not eating"
For any other input you should return: "Do you really care?"
=end
# My Solution
def worries(str)
op = ["Making last-minute changes",
"Sitting in a dark room and shaking",
"Crying",
"Laughing hysterically",
"Not eating"]
if op.include?(str)
"Stop worrying, everything will be all right!"
else
"Do you really care?"
end
end