Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions random_menu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
adjectives=["Creamy", "Crispy", "Juicy", "Sour", "Cold", "Hot", "Spicy", "Classic", "Gourmet", "Sweet" ]

cook=["deep-fried", "baked", "boiled", "caramelized" , "broiled", "fry", "grill", "roasted", "steamy", "stir-fried"]

food=["empanada", "pork", "chicken", "vegetables", "arepa", "salmon", "ceviche", "tofu", "tuna", "beef"]

10.times do |n|
puts (n+1).to_s + " " + adjectives.sample + " " + cook.sample + " " + food.sample
end
41 changes: 41 additions & 0 deletions random_menu_add.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
adjectives=[]
cook=[]
food=[]

puts "How many items do you want per array?"

y=gets.chomp.to_i

y.times do |n|
puts "Enter one adjective"
adj=gets.chomp
adjectives.insert(-1, adj)

puts "Enter one type of cooking"
co=gets.chomp
cook.insert(-1, co)

puts "Enter one kind of food"
fo=gets.chomp
food.insert(-1, fo)
end


puts "How many menu options would you like to see? You can choose at most #{y}"
q=gets.chomp.to_i

while q > y do
puts "You should enter a quantity less or equal to #{y}"
puts "How many menu options would you like to see? "
q=gets.chomp.to_i
end

q.times do |n|
a= adjectives.sample
c=cook.sample
f=food.sample
puts (n+1).to_s + " " + a+ " " + c+ " " + f
adjectives.delete(a)
cook.delete(c)
food.delete(f)
end