Created
August 10, 2016 00:18
-
-
Save jendiamond/c40675c95a05127878929d8b00d35584 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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