Skip to content

Instantly share code, notes, and snippets.

@lgranger
Created September 24, 2015 22:40
Show Gist options
  • Save lgranger/e8535d24a17f55e72d64 to your computer and use it in GitHub Desktop.
Save lgranger/e8535d24a17f55e72d64 to your computer and use it in GitHub Desktop.
def food_time
cooking_type = ["steamed", "fried", "sautéed", "grilled", "poached", "raw", "skewered", "roasted", "pan fried", "baked", "oven roasted", "simmered in sauce", "boiled", "sliced", "pickled", "brined", "sun-dried", "dehydrated", "chopped", "broiled"]
main_food = ["tofu", "seitan steaks", "TVP", "Field Roast", "beans", "lentils", "tempeh", "edamame", "chickpeas", "cutlets"]
veg = ["carrots", "kale", "okra", "tomatoes", "potatoes", "chard", "squash", "zucchini", "pumpkin", "pearl onions"]
puts "Do you want some food? yes or no?"
want_food = gets.chomp
x = 1
if want_food == "yes"
puts "Would you like to help us build the menu? yes or no?"
menu_builder = gets.chomp
if menu_builder == "yes"
puts "We're looking for main dishes, cooking types, and vegetables."
done_adding_main = ""
done_adding_cook_type = ""
done_adding_veg = ""
while done_adding_main != "no" do
puts "Would you like to add a main dish?"
add_main = gets.chomp
if add_main == "yes"
puts "What kind of main dish would you like to add?"
add_main = gets.chomp
main_food.push(add_main)
puts "Would you like to add another main dish? yes or no?"
done_adding_main = gets.chomp
else
done_adding_main = "no"
puts "Alright."
end
end
while done_adding_cook_type != "no" do
puts "Would you like to add a cooking type?"
add_type = gets.chomp
if add_type == "yes"
add_type = gets.chomp
cooking_type.push(add_type)
puts "Would you like to add another cooking type? yes or no?"
done_adding_cook_type = gets.chomp
else
done_adding_cook_type = "no"
puts "No problem."
end
end
while done_adding_veg != "no" do
puts "Would you like to add a vegetable?"
add_veg = gets.chomp
if add_veg =="yes"
puts "What kind of vegetables would you like to add?"
add_veg = gets.chomp
veg.push(add_veg)
puts "Would you like to add another vegetable dish? yes or no?"
done_adding_veg = gets.chomp
else
done_adding_veg = "no"
puts "OK."
end
end
else
puts "Ok!"
end
puts "How many menu items do you want to see? Ten or fewer please!"
how_many = gets.chomp.to_i
if how_many < 10
while x != how_many + 1 do
rand_type = cooking_type[rand(cooking_type.length)]
rand_type2 = cooking_type[rand(cooking_type.length)]
rand_food = main_food[rand(main_food.length)]
rand_veg = veg[rand(veg.length)]
puts "#{x}. #{rand_type} #{rand_food} with #{rand_type2} #{rand_veg}"
x += 1
cooking_type.delete(rand_type)
cooking_type.delete(rand_type2)
main_food.delete(rand_food)
veg.delete(rand_veg)
end
else
puts "That was too many! No food for you!"
end
elsif want_food == "no"
puts "Fine! No food for you!"
else
puts "That didn't make any sense. No food for you!"
end
end
puts food_time
@kariabancroft
Copy link

I like that you used a type of food and vegetable! So healthy 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment