Created
November 20, 2013 19:44
-
-
Save vanmichael/7569732 to your computer and use it in GitHub Desktop.
This file contains 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
train_times = { 1 => 2, | |
2 => 5, | |
3 => 7.5, | |
4 => 8.5, | |
5 => 9, | |
6 => 10, | |
7 => 11.5, | |
8 => 13.5, | |
9 => 14.5, | |
10=> 17, | |
11=>18, | |
12=>19, | |
13=>24 | |
} | |
possible_trains = [] | |
puts "What time is it?" | |
your_time = gets.chomp | |
train_times.each do |key,value| | |
if your_time.to_f <= value | |
possible_trains << key | |
end | |
end | |
puts "Take Train #{possible_trains.first} at #{train_times[possible_trains.first]}" | |
puts "***DON'T STOP...BELIEVIN'!**" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment