Skip to content

Instantly share code, notes, and snippets.

@dmehrotra
Last active December 21, 2015 14:28
Show Gist options
  • Save dmehrotra/6319756 to your computer and use it in GitHub Desktop.
Save dmehrotra/6319756 to your computer and use it in GitHub Desktop.
Journey
train={ 'Train 1' => 2, 'Train 2' => 5, 'Train 3' => 7.5, 'Train 4' => 8.5, 'Train 5' => 9, 'Train 6' => 10, 'Train 7' => 11.5, 'Train 8' => 13.5, 'Train 9' => 14.5, 'Train 10' => 17, 'Train 11' => 18,'Train 12' => 19, 'Train 13' => 24 }
print "what time do you want to leave: "
user_input = gets.chomp.to_f
def midnight_print
lyrics = "Just a small town girl Livin' in a lonely world She took the midnight train
Goin' anywhere
Just a city boy
Born and raised in South Detroit
He took the midnight train
Goin' anywhere
A singer in a smokey room
A smell of wine and cheap perfume
For a smile they can share the night
It goes on and on and on and on
Strangers waiting
Up and down the boulevard
Their shadows searching
In the night
Streetlights, people
Livin' just to find emotion
Hidin', somewhere in the night
Workin' hard to get my fill
Everybody wants a thrill
Payin' anything to roll the dice
Just one more time
Some will win
Some will lose
Some were born to sing the blues
Oh, the movie never ends
It goes on and on and on and on
Strangers waiting
Up and down the boulevard
Their shadows searching
In the night
Streetlights, people
Livin' just to find emotion
Hidin', somewhere in the night
[Instrumental Interlude]
Don't stop believin'
Hold on to the feelin'
Streetlights, people
Don't stop believin'
Hold on
Streetlights, people
"
print lyrics
end
train.each do |key, value|
if value >= user_input
puts "your should take #{key} at #{value}"
if value == 24
midnight_print
end
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment