Skip to content

Instantly share code, notes, and snippets.

@jendiamond
Created August 10, 2016 00:18
Show Gist options
  • Select an option

  • Save jendiamond/c40675c95a05127878929d8b00d35584 to your computer and use it in GitHub Desktop.

Select an option

Save jendiamond/c40675c95a05127878929d8b00d35584 to your computer and use it in GitHub Desktop.
def weather_report
weather = ['sunny','cloudy','humid','windy','rainy','chilly','cold',
'snowy','foggy','feezing','sleeting']
puts "What type of party are you having?"
party= gets.chomp
puts "Find out what the weather will be like on the day of your #{party}."
puts "Type in the words 'WEATHER REPORT' for a prediction."
get_prediction = gets.chomp
while get_prediction != "WEATHER REPORT"
puts "Type in the words 'WEATHER REPORT' for a prediction."
get_prediction = gets.chomp
if get_prediction != get_prediction.upcase
puts "I can't HEAR you."
else
puts "On the day of your #{party} it will be #{weather.sample}."
end
end
end
weather_report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment