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

done . #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
23 changes: 21 additions & 2 deletions mbta.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@

# your solution here
def stops_between_stations
def SBS(SL,SS,EL,ES)
stations{
"Red"=>["South Station","Park Street","Kendall",
"Central","Harvard", "Porter","Davis","Alewife"],
"Green"=>["Government Center", "Park Street", "Boylston",
"Arlington", "Copley", "Hynes", "Kenmore"],
"Orange"=>["North Station", "Haymarket", "ParkStreet",
"State", "Downtown Crossing", "Chinatown", "Back Bay",
"Forest Hills"]
}
if SL == EL
total_stops = stations.index(SS) - stations.index(ES)
elsif

end
end

upper_case_full_names = students.map do |student|
full_name = "#{student[:first_name]} #{student[:last_name]}"
full_name.upcase
end

puts upper_case_full_names.inspect
24 changes: 24 additions & 0 deletions subway.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$lines{
"Red"=>["South Station","Park Street","Kendall","Central","Harvard", "Porter","Davis","Alewife"],
"Green"=>["Government Center", "Park Street", "Boylston","Arlington", "Copley", "Hynes", "Kenmore"],
"Orange"=>["North Station", "Haymarket", "ParkStreet", "State", "Downtown Crossing", "Chinatown", "Back Bay", "Forest Hills"]
}


def count_stops(line, station1, station2)
station1_index = line.index(station1)
station2_index = line.index(station2)

real_stops = []
if station1_index <= station2_index
real_stops = line[station1_index..station2_index]
else
real_stops = line[station2_index..station1_index]
end

real_stops.length - 1
end

def stops_between_stations(start_line, start_station, end_line, end_stations)

end