<commit_before>[![General Assembly Logo](https://camo.githubusercontent.com/1a91b05b8f4d44b5bbfb83abac2b0996d8e26c92/687474703a2f2f692e696d6775722e636f6d2f6b6538555354712e706e67)](https://generalassemb.ly/education/web-development-immersive)

# MBTA practice

## To start

Fork, clone, branch (practice) and bundle install

## Objectives

-   Practice with classes, methods, and collections.
-   You may submit a pull request for this practice, but it is not required.

## Activity

-   Create a class in `lib/practice.rb` with a method `stops_between_stations`
to calculate the number of stops between stations on the "MBTA".
Write additional classes and or methods as needed.
-   The method takes the line and stop name that a rider is getting on at and
 the line and stop name that a rider is getting off at and **returns the total
  number of stops for the trip**.
-   When `MBTA::Subway::System.new` is called, its initialize method should
 store all the information needed by `stops_between_stations`.

There are 3 subway lines:

-   The Red line has the following stops: South Station, Park Street, Kendall,
 Central, Harvard, Porter, Davis, Alewife
-   The Green line has the following stops: Government Center, Park Street,
 Boylston, Arlington, Copley, Hynes, Kenmore
-   The Orange line has the following stops:  North Station, Haymarket,
Park Street, State, Downtown Crossing, Chinatown, Back Bay, Forest Hills
-   All 3 subway lines intersect at *Park Street*, but there are no other
 intersection points. Some of this MBTA is fictionalized.

## Checking your solution

Run `bin/rake test`.

## Hints

-   Assume good input.  Your function need not check the validity of the line or
 stop name.
-   Consider diagramming the lines by sketching out the subway lines and their
 stops and intersection.
-   The key to the practice is to find the **intersection** of the lines at
 *Park Street*.
-   Solve an easier problem first.

## Bonus

Think about adding Haymarket before Government Center on the Green line then try
 to find a solution when there are multiple intersections.
Is there a way to decide if a particular solution is "correct"?

This bonus is completely optional and does not have tests, yet.

## Tasks

Developers should run these often!

-   `bin/rake nag`  (or `bundle exec rake nag`):
    runs code quality analysis tools on your code and complains.
-   `bin/rake test` (or `bundle exec rake test`): runs automated tests
-   `bin/rake` will run both `nag` and `test`<commit_msg>Add hint about storing initialization data.<commit_after>[![General Assembly Logo](https://camo.githubusercontent.com/1a91b05b8f4d44b5bbfb83abac2b0996d8e26c92/687474703a2f2f692e696d6775722e636f6d2f6b6538555354712e706e67)](https://generalassemb.ly/education/web-development-immersive)

# MBTA practice

## To start

Fork, clone, branch (practice) and bundle install

## Objectives

-   Practice with classes, methods, and collections.
-   You may submit a pull request for this practice, but it is not required.

## Activity

-   Create a class in `lib/practice.rb` with a method `stops_between_stations`
to calculate the number of stops between stations on the "MBTA".
Write additional classes and or methods as needed.
-   The method takes the line and stop name that a rider is getting on at and
 the line and stop name that a rider is getting off at and **returns the total
  number of stops for the trip**.
-   When `MBTA::Subway::System.new` is called, its initialize method should
 store all the information needed by `stops_between_stations`.

There are 3 subway lines:

-   The Red line has the following stops: South Station, Park Street, Kendall,
 Central, Harvard, Porter, Davis, Alewife
-   The Green line has the following stops: Government Center, Park Street,
 Boylston, Arlington, Copley, Hynes, Kenmore
-   The Orange line has the following stops:  North Station, Haymarket,
Park Street, State, Downtown Crossing, Chinatown, Back Bay, Forest Hills
-   All 3 subway lines intersect at *Park Street*, but there are no other
 intersection points. Some of this MBTA is fictionalized.

## Checking your solution

Run `bin/rake test`.

## Hints

-   Assume good input.  Your function need not check the validity of the line or
    stop name.
-   Think about where to store initialization data.
-   Consider diagramming the lines by sketching out the subway lines and their
    stops and intersection.
-   The key to the practice is to find the **intersection** of the lines at
    *Park Street*.
-   Solve an easier problem first.

## Bonus

Think about adding Haymarket before Government Center on the Green line then try
 to find a solution when there are multiple intersections.
Is there a way to decide if a particular solution is "correct"?

This bonus is completely optional and does not have tests, yet.

## Tasks

Developers should run these often!

-   `bin/rake nag`  (or `bundle exec rake nag`):
    runs code quality analysis tools on your code and complains.
-   `bin/rake test` (or `bundle exec rake test`): runs automated tests
-   `bin/rake` will run both `nag` and `test`
{'fraction_non_alphanumeric': 0.06637947914626982, 'fraction_numerical': 0.028196592911689838, 'mean_word_length': 4.108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6997238', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1434, 'n_words': 693}