-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshopping_arrays.rb
88 lines (48 loc) · 1.42 KB
/
shopping_arrays.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# def ass_hat (material)
# materials = ['nylon' 'cotton' 'wool']
# if materials.include?(material.downcase)
# "Built ass hat with #{material}"
# else
# "Sorry can't do that"
# end
# end
# puts ass_hat ("leather")
# def ass_hat (level, warm, material)
# "You're an ass hat of level #{level}!! You R rating is #{ass_hat_warm_rating (warm)} and material is #{material}."
# end
# def ass_hat_warm_rating(warm_rating)
# warm_rating * 2
# end
# ass_hat_level = 5
# puts ass_hat(ass_hat_level, 25) #same as puts ass_hat(5)
# puts ass_hat(ass_hat_level, 45, "nylon")
# puts ass_hat(ass_hat_level, 12)
# puts ass_hat(ass_hat_level, 8)
def sunday
"Time to go food shopping!"
end
def shopping_list(list, time, money)
"Today you have to purchase #{list} at #{places_to_shop}. You have #{time} minutes and #{money} dollars."
end
def places_to_shop
"whole_foods, king_supers, or safeway"
end
def shop_list(thing)
list = ['milk' 'eggs' 'fruit' 'veggies']
if list.include?(thing)
"You can buy these #{list} items"
else
"Sorry you can't afford that"
end
end
puts shopping_list('milk eggs', "60", "50")
puts "Can I afford salmon?"
puts shop_list("salmon")
# time = "60"
# money = "50"
# # puts shopping_list(list, time, money)
# # puts places_to_shop('whole_foods', 'king_supers', 'safeway')
# store1 = "whole_foods"
# store2 = "king_supers"
# store3 = "safeway"
# # puts places_to_shop(store1, store2, store3)