Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampers: Alex #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
30 changes: 30 additions & 0 deletions alex_menu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
preps = %w(raw grilled seared baked boiled chopped frozen sauteed steamed melted)
descriptions = %w(greasy creamy tart smokey savory sweet spicy rancid buttery salty)
foods = %w(chicken pork mushrooms carrots beef onions fish soup tofu pasta)

print "Welcome to the Random Menu Generator.\n\n"
print "How many dishes would you like to eat today? "
num = gets.chomp.to_i

while num > 10 || num < 1
if num > 10
print "Sorry, 10 is the most I can do. How many under 10 would you like? "
num = gets.chomp.to_i
end
if num < 1
print "Sorry, must select at least 1 dish: "
num = gets.chomp.to_i
end
end

puts "\n=== Random Menu ==="

(1..num).each do |i|
one = preps.sample
two = descriptions.sample
three = foods.sample
puts "#{i}. #{one} #{two} #{three}"
preps.delete(one)
descriptions.delete(two)
foods.delete(three)
end