Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H.W week-7 day-2 #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions mbta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
red_line = ["South Station ", "Park Street ", "Kendall", "Central", "Harvard" , "Porter" , "Davis" ,"Alewife" ]
green_line = [ "Government Center" ,"Park Street ", "Boylston" , "Arlington" , "Copley" , "Hynes", "Kenmore"]
orange_line = [ "North Station" , "Haymarket" , "Park Street" , "State" , "Downtown Crossing" , "Chinatown" , "Back Bay ", "Forest Hills"]

# your solution here
def stops_between_stations
#puts red_lien , green_lien ,orange_line

end


def number_of_station(start_line, start_point, end_line, end_point)
puts end_line.index(end_point) - start_line.index(start_point)
# puts 5 - 10
end

start_point = "Kendall"
start_line = red_line
end_point = "Alewife"
end_line = red_line

puts number_of_station(start_line, start_point, end_line, end_point)