Skip to content

Instantly share code, notes, and snippets.

@msmith7904
Created October 20, 2014 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msmith7904/fbab4549910eb1718537 to your computer and use it in GitHub Desktop.
Save msmith7904/fbab4549910eb1718537 to your computer and use it in GitHub Desktop.
def main_menu
puts "List train lines (T)? List Stations (Sta)? Quit program (Q)? Please make a selection."
end
loop do
main_menu
answer = gets.chomp.to_s
if answer == "T"
puts "The (L) Train, The (N) Train, The (S)ix Train"
elsif answer == "Sta"
puts "The (L) Train, The (N) Train, The (S)ix Train Choose a train line by letter."
selection = gets.chomp.to_s
if selection == "L"
puts "You selected the L train."
puts "8th Ave, 6th Ave, Union Square, 3rd Ave, 1st Ave, Bedford Ave"
elsif selection == "N"
puts "You selected the N train."
puts "Times Square, Herald Square, 28th St, 23rd St - HMH Nexus,
Union Square, 8th Ave"
elsif selection == "S"
puts "You selected the Six Train."
puts "Grand Central, 33rd St, 28th St, 23rd St, Union Square, Astor Place"
else
puts "That's not one of the choices."
end
else answer == "Q"
puts "Thank You"
break
end
end
@harimohanraj89
Copy link

Great! Next step, pay attention to your indentation to make sure your code visually represents its structure!

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