-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathinfinite.rb
57 lines (42 loc) · 1.34 KB
/
infinite.rb
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
favorite_animal = nil
print "What's your first name?"
name = gets.chomp.capitalize
if name.start_with?("A")
print "What is your favorite animal?"
favorite_animal = gets.chomp
end
puts "Your favorite animal is #{favorite_animal}"
# names = ["Kasey", "Steph", "Mina", "Laneia", "Cloudy"]
# favorite_animal = ""
# names.each do |name|
# print "What is the favorite animal of #{name}?\t"
# favorite_animal = gets.chomp
# puts "\t#{favorite_animal} is mine too!"
# end
# puts "Favorite Animal is #{favorite_animal}"
# # list = ["Goofy", "Minnie", "Daisy"]
# # greeting = nil
# # list.each do |name|
# # name << "' birthday! "
# # greeting = name
# # end
# # puts greeting
# # # list = ["Goofy", "Minnie", "Daisy"]
# # # name = "Donald"
# # # list.each do |name|
# # # name << " birthday! "
# # # end
# # # puts name
# # # # numbers = [1, 2, 3, 4, 5]
# # # # numbers.each do |number|
# # # # puts number
# # # # numbers.push(number * 2)
# # # # end
# # # # # print "Do you like dogs or cats?"
# # # # # pet = gets.chomp.downcase
# # # # # until pet == "dogs"
# # # # # puts "How rude! I don't believe you, how can anyone not prefer dogs!"
# # # # # print "Come now, tell me truthfully, do you like cats or dogs?"
# # # # # pet = gets.chomp.downcase
# # # # # end
# # # # # puts "Oh you like dogs now too! We'll be such good friends!"