Skip to content
Open
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
23 changes: 23 additions & 0 deletions random-menu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#arrays
adjectives = ["hot", "cold", "warm", "freezing","sizzling", "lukewarm",
"boiling", "blazing", "red", "flaming"]
cooking_style = ["steamed", "boiled", "sautéed", "barbecued", "braised", "charbroiled",
"cured", "dry-roasted", "fried", "glazed"]
foods = ["potatoes", "salad", "lasagna", "pizza", "chicken", "lobsters", "pad-thai", "eggplant",
"eggs", "soup"]


result_a = []
1.times { result_a << adjectives.slice!( rand(adjectives.size) ) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this indented?


result_c = []
1.times { result_c << cooking_style.slice!( rand(cooking_style.size) ) }

result_f = []
#1.times { result_f << foods.slice!( rand(foods.size) ) }
1.times { result_f << foods.slice!(rand(foods)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a close parentheses & instead of foods this should be foods.length


random_food_item = result_a + result_c + result_f
(1...2).each do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only doing 1 food item

puts random_food_item
end