-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrandma.rb
More file actions
37 lines (35 loc) · 689 Bytes
/
grandma.rb
File metadata and controls
37 lines (35 loc) · 689 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
29
30
31
32
33
34
35
36
37
#puts 'HUH?!'
#talk=gets.chomp
#while true
# if talk != talk.upcase
# puts 'HUH SPEAK UP SUNNY!'
# talk=gets.chomp
#else
#response=puts 'no not since '+(rand(20)+1929).to_s+''
#break
# def gets'BYE'
# bye=gets.chomp
# if bye='BYE'
# bye_count+=1
#end
#end
#response=puts 'no not since '+(rand(20)+1929).to_s+''
#response= puts 'What do you say?'
bye_count=0
puts 'What did you say?'
while bye_count<3
bye=gets.chomp
if bye=='bye'.upcase
bye_count+=1
else
bye_count=0
puts 'What did you say?'
end
end
puts'Goodbye'
#else
# puts 'Try Again'
# bye_count=0
# puts 'What did you say?'
#bye=gets.chomp
# end