チューブのどこかに…しかし、どの行に?


26

The London Underground AKA The Tubeは、世界最古の地下鉄です。現在、267の名前の駅(「Edgware Road」と「Hammersmith」以降は厳密に269 **の駅)にサービスを提供する11路線で構成されています。

チャレンジ

入力として名前で指定されたステーションにサービスを提供する回線の名前を出力します。

入力:
文字列または文字のリスト

  • これは、有効なステーション名であると想定される場合があります(以下のコードブロックにリストされています)。

  • 必要に応じ&て、入力内のいずれかが一貫して単語and(またはAnd)であると想定し、回答に明確に記述してください。

出力:
分離そのステーションにサービスを提供する11行の出力をリストする出力:

  • 文字列のリスト、文字のリストのリスト、印刷されたテキスト、文字列、文字のリスト。疑問がある場合は尋ねてください。

  • あなたはよい一貫出力単語をand(またはAndいずれかの場所で)&希望場合ますが、答えにこれを明記してください。

  • セパレーター部分文字列が使用する文字列または文字のリストを印刷または返す場合、行名のいずれにも存在しない(&またはandorまたはAnd使用済みを含む)-したがって、セパレーターとしての単一のスペース文字の使用は除外されることに注意してください。

チューブネットワーク
-注:スペルミスが発生した場合でも、これは最終状態です(回答の前に対処しない限り)。

Input (Station Name)         : Output (list of tube line names)
----------------------------------------------------------------------------------------------------------------
"Acton Town"                 : ["District","Piccadilly"]
"Aldgate"                    : ["Circle","Metropolitan"]
"Aldgate East"               : ["District","Hammersmith & City"]
"Alperton"                   : ["Piccadilly"]
"Amersham"                   : ["Metropolitan"]
"Angel"                      : ["Northern"]
"Archway"                    : ["Northern"]
"Arnos Grove"                : ["Piccadilly"]
"Arsenal"                    : ["Piccadilly"]
"Baker Street"               : ["Bakerloo","Circle","Hammersmith & City","Jubilee","Metropolitan"]
"Balham"                     : ["Northern"]
"Bank"                       : ["Central","Northern","Waterloo & City"]
"Barbican"                   : ["Circle","Hammersmith & City","Metropolitan"]
"Barking"                    : ["District","Hammersmith & City"]
"Barkingside"                : ["Central"]
"Barons Court"               : ["District","Piccadilly"]
"Bayswater"                  : ["Circle","District"]
"Becontree"                  : ["District"]
"Belsize Park"               : ["Northern"]
"Bermondsey"                 : ["Jubilee"]
"Bethnal Green"              : ["Central"]
"Blackfriars"                : ["Circle","District"]
"Blackhorse Road"            : ["Victoria"]
"Bond Street"                : ["Central","Jubilee"]
"Borough"                    : ["Northern"]
"Boston Manor"               : ["Piccadilly"]
"Bounds Green"               : ["Piccadilly"]
"Bow Road"                   : ["District","Hammersmith & City"]
"Brent Cross"                : ["Northern"]
"Brixton"                    : ["Victoria"]
"Bromley-by-Bow"             : ["District","Hammersmith & City"]
"Buckhurst Hill"             : ["Central"]
"Burnt Oak"                  : ["Northern"]
"Caledonian Road"            : ["Piccadilly"]
"Camden Town"                : ["Northern"]
"Canada Water"               : ["Jubilee"]
"Canary Wharf"               : ["Jubilee"]
"Canning Town"               : ["Jubilee"]
"Cannon Street"              : ["Circle","District"]
"Canons Park"                : ["Jubilee"]
"Chalfont & Latimer"         : ["Metropolitan"]
"Chalk Farm"                 : ["Northern"]
"Chancery Lane"              : ["Central"]
"Charing Cross"              : ["Bakerloo","Northern"]
"Chesham"                    : ["Metropolitan"]
"Chigwell"                   : ["Central"]
"Chiswick Park"              : ["District"]
"Chorleywood"                : ["Metropolitan"]
"Clapham Common"             : ["Northern"]
"Clapham North"              : ["Northern"]
"Clapham South"              : ["Northern"]
"Cockfosters"                : ["Piccadilly"]
"Colindale"                  : ["Northern"]
"Colliers Wood"              : ["Northern"]
"Covent Garden"              : ["Piccadilly"]
"Croxley"                    : ["Metropolitan"]
"Dagenham East"              : ["District"]
"Dagenham Heathway"          : ["District"]
"Debden"                     : ["Central"]
"Dollis Hill"                : ["Jubilee"]
"Ealing Broadway"            : ["Central","District"]
"Ealing Common"              : ["District","Piccadilly"]
"Earl's Court"               : ["District","Piccadilly"]
"East Acton"                 : ["Central"]
"East Finchley"              : ["Northern"]
"East Ham"                   : ["District","Hammersmith & City"]
"East Putney"                : ["District"]
"Eastcote"                   : ["Metropolitan","Piccadilly"]
"Edgware"                    : ["Northern"]
"Edgware Road"               : ["Bakerloo","Circle","District","Hammersmith & City"]
"Elephant & Castle"          : ["Bakerloo","Northern"]
"Elm Park"                   : ["District"]
"Embankment"                 : ["Bakerloo","Circle","District","Northern"]
"Epping"                     : ["Central"]
"Euston"                     : ["Northern","Victoria"]
"Euston Square"              : ["Circle","Hammersmith & City","Metropolitan"]
"Fairlop"                    : ["Central"]
"Farringdon"                 : ["Circle","Hammersmith & City","Metropolitan"]
"Finchley Central"           : ["Northern"]
"Finchley Road"              : ["Jubilee","Metropolitan"]
"Finsbury Park"              : ["Piccadilly","Victoria"]
"Fulham Broadway"            : ["District"]
"Gants Hill"                 : ["Central"]
"Gloucester Road"            : ["Circle","District","Piccadilly"]
"Golders Green"              : ["Northern"]
"Goldhawk Road"              : ["Circle","Hammersmith & City"]
"Goodge Street"              : ["Northern"]
"Grange Hill"                : ["Central"]
"Great Portland Street"      : ["Circle","Hammersmith & City","Metropolitan"]
"Greenford"                  : ["Central"]
"Green Park"                 : ["Jubilee","Piccadilly","Victoria"]
"Gunnersbury"                : ["District"]
"Hainault"                   : ["Central"]
"Hammersmith"                : ["Circle","District","Hammersmith & City","Piccadilly"]
"Hampstead"                  : ["Northern"]
"Hanger Lane"                : ["Central"]
"Harlesden"                  : ["Bakerloo"]
"Harrow & Wealdstone"        : ["Bakerloo"]
"Harrow-on-the-Hill"         : ["Metropolitan"]
"Hatton Cross"               : ["Piccadilly"]
"Heathrow Terminals 1, 2, 3" : ["Piccadilly"]
"Heathrow Terminal 4"        : ["Piccadilly"]
"Heathrow Terminal 5"        : ["Piccadilly"]
"Hendon Central"             : ["Northern"]
"High Barnet"                : ["Northern"]
"Highbury & Islington"       : ["Victoria"]
"Highgate"                   : ["Northern"]
"High Street Kensington"     : ["Circle","District"]
"Hillingdon"                 : ["Metropolitan","Piccadilly"]
"Holborn"                    : ["Central","Piccadilly"]
"Holland Park"               : ["Central"]
"Holloway Road"              : ["Piccadilly"]
"Hornchurch"                 : ["District"]
"Hounslow Central"           : ["Piccadilly"]
"Hounslow East"              : ["Piccadilly"]
"Hounslow West"              : ["Piccadilly"]
"Hyde Park Corner"           : ["Piccadilly"]
"Ickenham"                   : ["Metropolitan","Piccadilly"]
"Kennington"                 : ["Northern"]
"Kensal Green"               : ["Bakerloo"]
"Kensington (Olympia)"       : ["District"]
"Kentish Town"               : ["Northern"]
"Kenton"                     : ["Bakerloo"]
"Kew Gardens"                : ["District"]
"Kilburn"                    : ["Jubilee"]
"Kilburn Park"               : ["Bakerloo"]
"Kingsbury"                  : ["Jubilee"]
"King's Cross St. Pancras"   : ["Circle","Hammersmith & City","Metropolitan","Northern","Piccadilly","Victoria"]
"Knightsbridge"              : ["Piccadilly"]
"Ladbroke Grove"             : ["Circle","Hammersmith & City"]
"Lambeth North"              : ["Bakerloo"]
"Lancaster Gate"             : ["Central"]
"Latimer Road"               : ["Circle","Hammersmith & City"]
"Leicester Square"           : ["Northern","Piccadilly"]
"Leyton"                     : ["Central"]
"Leytonstone"                : ["Central"]
"Liverpool Street"           : ["Central","Circle","Hammersmith & City","Metropolitan"]
"London Bridge"              : ["Jubilee","Northern"]
"Loughton"                   : ["Central"]
"Maida Vale"                 : ["Bakerloo"]
"Manor House"                : ["Piccadilly"]
"Mansion House"              : ["Circle","District"]
"Marble Arch"                : ["Central"]
"Marylebone"                 : ["Bakerloo"]
"Mile End"                   : ["Central","District","Hammersmith & City"]
"Mill Hill East"             : ["Northern"]
"Monument"                   : ["Circle","District"]
"Moorgate"                   : ["Circle","Hammersmith & City","Metropolitan","Northern"]
"Moor Park"                  : ["Metropolitan"]
"Morden"                     : ["Northern"]
"Mornington Crescent"        : ["Northern"]
"Neasden"                    : ["Jubilee"]
"Newbury Park"               : ["Central"]
"North Acton"                : ["Central"]
"North Ealing"               : ["Piccadilly"]
"North Greenwich"            : ["Jubilee"]
"North Harrow"               : ["Metropolitan"]
"North Wembley"              : ["Bakerloo"]
"Northfields"                : ["Piccadilly"]
"Northolt"                   : ["Central"]
"Northwick Park"             : ["Metropolitan"]
"Northwood"                  : ["Metropolitan"]
"Northwood Hills"            : ["Metropolitan"]
"Notting Hill Gate"          : ["Central","Circle","District"]
"Oakwood"                    : ["Piccadilly"]
"Old Street"                 : ["Northern"]
"Osterley"                   : ["Piccadilly"]
"Oval"                       : ["Northern"]
"Oxford Circus"              : ["Bakerloo","Central","Victoria"]
"Paddington"                 : ["Bakerloo","Circle","District","Hammersmith & City"]
"Park Royal"                 : ["Piccadilly"]
"Parsons Green"              : ["District"]
"Perivale"                   : ["Central"]
"Piccadilly Circus"          : ["Bakerloo","Piccadilly"]
"Pimlico"                    : ["Victoria"]
"Pinner"                     : ["Metropolitan"]
"Plaistow"                   : ["District","Hammersmith & City"]
"Preston Road"               : ["Metropolitan"]
"Putney Bridge"              : ["District"]
"Queen's Park"               : ["Bakerloo"]
"Queensbury"                 : ["Jubilee"]
"Queensway"                  : ["Central"]
"Ravenscourt Park"           : ["District"]
"Rayners Lane"               : ["Metropolitan","Piccadilly"]
"Redbridge"                  : ["Central"]
"Regent's Park"              : ["Bakerloo"]
"Richmond"                   : ["District"]
"Rickmansworth"              : ["Metropolitan"]
"Roding Valley"              : ["Central"]
"Royal Oak"                  : ["Circle","Hammersmith & City"]
"Ruislip"                    : ["Metropolitan","Piccadilly"]
"Ruislip Gardens"            : ["Central"]
"Ruislip Manor"              : ["Metropolitan","Piccadilly"]
"Russell Square"             : ["Piccadilly"]
"St. James's Park"           : ["Circle","District"]
"St. John's Wood"            : ["Jubilee"]
"St. Paul's"                 : ["Central"]
"Seven Sisters"              : ["Victoria"]
"Shepherd's Bush"            : ["Central"]
"Shepherd's Bush Market"     : ["Circle","Hammersmith & City"]
"Sloane Square"              : ["Circle","District"]
"Snaresbrook"                : ["Central"]
"South Ealing"               : ["Piccadilly"]
"South Harrow"               : ["Piccadilly"]
"South Kensington"           : ["Circle","District","Piccadilly"]
"South Kenton"               : ["Bakerloo"]
"South Ruislip"              : ["Central"]
"South Wimbledon"            : ["Northern"]
"South Woodford"             : ["Central"]
"Southfields"                : ["District"]
"Southgate"                  : ["Piccadilly"]
"Southwark"                  : ["Jubilee"]
"Stamford Brook"             : ["District"]
"Stanmore"                   : ["Jubilee"]
"Stepney Green"              : ["District","Hammersmith & City"]
"Stockwell"                  : ["Northern","Victoria"]
"Stonebridge Park"           : ["Bakerloo"]
"Stratford"                  : ["Central","Jubilee"]
"Sudbury Hill"               : ["Piccadilly"]
"Sudbury Town"               : ["Piccadilly"]
"Swiss Cottage"              : ["Jubilee"]
"Temple"                     : ["Circle","District"]
"Theydon Bois"               : ["Central"]
"Tooting Bec"                : ["Northern"]
"Tooting Broadway"           : ["Northern"]
"Tottenham Court Road"       : ["Central","Northern"]
"Tottenham Hale"             : ["Victoria"]
"Totteridge & Whetstone"     : ["Northern"]
"Tower Hill"                 : ["Circle","District"]
"Tufnell Park"               : ["Northern"]
"Turnham Green"              : ["District","Piccadilly"]
"Turnpike Lane"              : ["Piccadilly"]
"Upminster"                  : ["District"]
"Upminster Bridge"           : ["District"]
"Upney"                      : ["District"]
"Upton Park"                 : ["District","Hammersmith & City"]
"Uxbridge"                   : ["Metropolitan","Piccadilly"]
"Vauxhall"                   : ["Victoria"]
"Victoria"                   : ["Circle","District","Victoria"]
"Walthamstow Central"        : ["Victoria"]
"Wanstead"                   : ["Central"]
"Warren Street"              : ["Northern","Victoria"]
"Warwick Avenue"             : ["Bakerloo"]
"Waterloo"                   : ["Bakerloo","Jubilee","Northern","Waterloo & City"]
"Watford"                    : ["Metropolitan"]
"Wembley Central"            : ["Bakerloo"]
"Wembley Park"               : ["Jubilee","Metropolitan"]
"West Acton"                 : ["Central"]
"West Brompton"              : ["District"]
"West Finchley"              : ["Northern"]
"West Ham"                   : ["District","Hammersmith & City","Jubilee"]
"West Hampstead"             : ["Jubilee"]
"West Harrow"                : ["Metropolitan"]
"West Kensington"            : ["District"]
"West Ruislip"               : ["Central"]
"Westbourne Park"            : ["Circle","Hammersmith & City"]
"Westminster"                : ["Circle","District","Jubilee"]
"White City"                 : ["Central"]
"Whitechapel"                : ["District","Hammersmith & City"]
"Willesden Green"            : ["Jubilee"]
"Willesden Junction"         : ["Bakerloo"]
"Wimbledon"                  : ["District"]
"Wimbledon Park"             : ["District"]
"Wood Green"                 : ["Piccadilly"]
"Wood Lane"                  : ["Circle","Hammersmith & City"]
"Woodford"                   : ["Central"]
"Woodside Park"              : ["Northern"]

... 11行の名前は次のとおりです。

Bakerloo
Central
Circle
District
Hammersmith & City
Jubilee
Metropolitan
Northern
Piccadilly
Victoria
Waterloo & City

*ロンドンの交通機関は他の列車も管理しています。一部の列車は「The Tube」(おそらく「Docklands Light Railway」または「DLR」)の一部と呼ばれることもありますが、ここに記載されている11路線に固執します。

**リンクされたウィキペディアのページには現在270と記載されていますが、「DLR」のみを提供しているにもかかわらず、カナリーワーフの2番目の場所を誤ってカウントしていると思われます)


モーニングトンクレセント(互換性のあるIDEがこちらから入手可能です)を使用したゴルフの提出のための想像上のブラウニーポイントの山(そして、多くの場合、多くの賛成票もあります)!


これはであるため、バイト単位の最短コードが言語ごとに勝ち、最短ソリューションが勝ちます(ゴルフ言語が他の言語でゴルフをやめさせないでください)。楽しむ!


1
私は去るつもりだ、これをここに。私もこの答えを提出したくありません。> _>私はしませんでした...リアライズこれはどのように...大きい...
totallyhuman

2
@icrieverytimゴルフグローブを着用してください:)
ジョナサンアラン

それで、ただの... 一連のチューブですよね?¯\ _(ツ)_ /¯
アルノー

2
@Arnauldもちろん、まったくそうではありません。「チューブに乗る」、「チューブを変更する」、「間違ったチューブに乗る」、「最初のチューブを取得する」、または「最後のチューブを取得する」ことができますが、チューブは1つしかありません:)
ジョナサンアラン

3
ジェイ・フォアマンと一緒に歌いましょ
TRiG

回答:


14

Mathematica 8 +、266バイト

t=Merge[Cases[<<ExamplePages/TripPlanning.nb,_@v__~_~{_->l_}:>(#->l&/@{v}),-1],Union@@#&];
x(r=t@@Nearest[Keys@t]@StringReplace[__~~"d Lane"|"ket"->"Royal Oak"]@x;DeleteCases[
  If[x<>r[[1]]//StringFreeQ@"sm",{},{"Circle"}]⋃r,"Overground"|"Docklands Light Rail"])

このソリューションはもともと、ステーションと同じバイト数でした。私はそれがさらに50バイトかそこらを下にゴルフすることができると思うが、これは今のところ立ち止まるのにふさわしい場所のように思われた。


前書き

Mathematicaは、その大規模な標準ライブラリと大規模なオンライン「計算可能な知識ベース」へのアクセスでよく知られています。関連する輸送データを簡単に見つけられることを期待して、Wolfram | Alphaを真剣に検索しましたが、クエリのドメインは理解していますが、データはまだ利用できません

幸いなことに、Mathematicaの豊富な組み込みドキュメントにはきちんとした例が付属しています。それらのページのいくつかは、たまたまロンドン地下鉄ネットワークを使用して、グラフ関連の機能を実証しています。短い名前のため、「Trip Planning」機能の例のグラフを使用します。

同じネットワークの他のクールな使用法を次に示します

Mathematicaのドキュメントにプログラムでアクセスすることは、「外部ソースから取得する」タイプの抜け穴に該当するとは思わない。


サンプルページをインポートする

サンプルページをノートブック式としてインポートできます。

<<ExamplePages/TripPlanning.nb
Notebook[{Cell[ ... ], ... }, Saveable -> False, ...]

ノートブック式の奥深くからグラフ全体を抽出することができます。

g = FirstCase[<< ExamplePages/TripPlanning.nb, _Graph, , -1];
VertexList[g]
{"Acton Central", "Acton Town", "Aldgate", ...}  

グラフの頂点は単なるステーション名であることに注意してください。エッジには、"Lines"2つのステーション間を通る線を表す文字列のリストであるカスタムプロパティがあります。

# -> PropertyValue[{g, #}, "Lines"] & /@ EdgeList[g]
{...,
 "Acton Town" <-> "Chiswick Park" -> {"District"}, 
 "Acton Town" <-> "Ealing Common" -> {"District", "Piccadilly"},
 ...}

ここで、すべての入射エッジをから取得することにより、頂点を通過するすべての線を見つけることができますIncidenceList[g, vertex]、マッピングPropertyValue[{g, edge}, "Lines"]したり、それらにしたりするなどし。

ただし、上記のメソッドをスキップして、Graphコンストラクターの関連部分のパターンマッチングにより多くのバイトを保存します。Propertiesオプション)のます。

行を抽出する

Graphコンストラクタの形式は次のとおりです。

Graph[
  {v1, v2, ...},
  {e1, e2, ...},
  Properties -> {
    v1 -> {propertyName -> propertyValue},
    e1 -> {propertyName -> propertyValue},   (* one edge property *)
    ...
  }
]

(これFullForm[g]は、ソースコードを検査または読み取ることで確認できます。TripPlanning.nbフルパスについては、次を実行します。FindFile["ExamplePages/TripPlanning.nb"]ます。)

次に、1つのエッジプロパティの例を示します。

UndirectedEdge["Embankment", "Waterloo"] -> {"Lines" -> {"Bakerloo", "Northern"}}

この式をコンパクトなパターンに変えましょう。

UndirectedEdge[v1_, v2_]  ->      {"Lines" -> lines_}
UndirectedEdge[v1_, v2_]  ~Rule~  {"Lines" -> lines_}
UndirectedEdge[v__]       ~Rule~  {_       -> lines_}
             _[v__]       ~Rule~  {_       -> l_    }
             _@v__        ~_~     {_       -> l_    }

             _@v__~_~{_->l_}

ルックアップテーブルを作成する

これv1v2、とを一致させることができますlinesが、必要です{v1 -> lines, v2 -> lines}。役立つのはCases、パターンの一致と変換を同時に行えることです。

Cases[notebook,  _@v__~_~{_->l_} :> (# -> l & /@ { v }),  -1]
                 [ the pattern ]    [ the replacement ]

これにより、フォームのリストが生成され{{v1 -> lines, v2 -> lines}, {v1 -> lines, v3 -> lines}, ...}ます。最後に、頂点ごとにリストをマージします。

t=Merge[Cases[...], Union@@#&];

90バイト未満で、各ステーションの回線に対してほぼ完璧なルックアップテーブルを作成しました。

t=Merge[Cases[<<ExamplePages/TripPlanning.nb,_@s__~_~{_->l_}:>(#->l&/@{s}),-1],Union@@#&]
<| "Embankment"       -> {"Bakerloo", "Circle", "District", "Northern"},
   "Waterloo"         -> {"Bakerloo", "Jubilee", "Northern", "Waterloo & City"},
   "Brondesbury"      -> {"Overground"},
    ... |>

タイプミスを修正

残念ながら、一部のステーション名のスペルが間違っているか、欠落しています。

あいまいな文字列のマッチングでタイプミスを処理する必要があります。Nearest入力されたステーション名につづりが間違っているステーション名を見つけることができます。

Nearest[Keys@t]

"Wood Lane"および"Shepherd's Bush Market"(新しいステーション)の入力をに置き換えます。"Royal Oak"これらの3つのステーションは同じ行を共有するためです。

StringReplace[__ ~~ "d Lane" | "ket" -> "Royal Oak"]

これらの関数を作成して、偽のステーション名を取得し、テーブルでその行を検索し、次の場所に保存しrます。

r=t@@Nearest[Keys@t]@StringReplace[__~~"d Lane"|"ket"->"Royal Oak"]@x

古いものを修正

サークルラインのオーバーホールにより、ネットワークも少し古くなっています。

入力ステーションがである"Hammersmith"場合、またはルックアップテーブルがのみを返す場合、行に{"Hammersmith & City"}追加"Circle"します。

If[x <> r[[1]] // StringFreeQ@"sm", {}, {"Circle"}] ⋃ r

余分な線を削除する

グラフには気にしない線がいくつか含まれているので、それらを削除します。

DeleteCases[..., "Overground"|"Docklands Light Rail"]

それでおしまい!


それを試してみてください!(回避策あり)

私のソリューションを試したいが、Mathematicaを持っていない場合は、無料のWolfram Programming Cloudを使用できます。ここ移動してをクリックしCreate a New Notebook、しばらく待ってください。

残念ながら、このプラットフォームには、ノートブックをインポートするコードが機能しないという制限があります。粗雑な回避策は次のとおりです。

サンプルページがないため、オンラインドキュメントのcopy-input-to-clipboard関数を悪用しようとする可能性があります。ブラウザーの開発者ツールを使用して、リクエストが行われたことを確認しましたhttp://reference.wolfram.com/language/example/Files/TripPlanning.en/i_1.txt(警告:大)。ただし、プラットフォームのプロキシはドメインを解決しないため、reference.wolfram.com手動で行いました。

gWorkaround = ToExpression[
  FirstCase[
    Import["http://140.177.205.163/language/example/Files/TripPlanning.en/i_1.txt",
      {"HTML","XMLObject"}],
    XMLElement["pre", _, {a_}] :> a,
    ,-1
  ],
  InputForm, Hold];

これを最初に貼り付け、を押しshift+enterて実行します。今すぐ交換してください<<ExamplePages/TripPlanning.nbgWorkaround


テストデータ

関数fを呼び出して、指定されたデータでテストします。

f = %;

testData = <|"Acton Town" -> {"District", "Piccadilly"}, "Aldgate" -> {"Circle", "Metropolitan"}, "Aldgate East" -> {"District", "Hammersmith & City"}, "Alperton" -> {"Piccadilly"}, "Amersham" -> {"Metropolitan"}, "Angel" -> {"Northern"}, "Archway" -> {"Northern"}, "Arnos Grove" -> {"Piccadilly"}, "Arsenal" -> {"Piccadilly"}, "Baker Street" -> {"Bakerloo", "Circle", "Hammersmith & City", "Jubilee", "Metropolitan"}, "Balham" -> {"Northern"}, "Bank" -> {"Central", "Northern", "Waterloo & City"}, "Barbican" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Barking" -> {"District", "Hammersmith & City"}, "Barkingside" -> {"Central"}, "Barons Court" -> {"District", "Piccadilly"}, "Bayswater" -> {"Circle", "District"}, "Becontree" -> {"District"}, "Belsize Park" -> {"Northern"}, "Bermondsey" -> {"Jubilee"}, "Bethnal Green" -> {"Central"}, "Blackfriars" -> {"Circle", "District"}, "Blackhorse Road" -> {"Victoria"}, "Bond Street" -> {"Central", "Jubilee"}, "Borough" -> {"Northern"}, "Boston Manor" -> {"Piccadilly"}, "Bounds Green" -> {"Piccadilly"}, "Bow Road" -> {"District", "Hammersmith & City"}, "Brent Cross" -> {"Northern"}, "Brixton" -> {"Victoria"}, "Bromley-by-Bow" -> {"District", "Hammersmith & City"}, "Buckhurst Hill" -> {"Central"}, "Burnt Oak" -> {"Northern"}, "Caledonian Road" -> {"Piccadilly"}, "Camden Town" -> {"Northern"}, "Canada Water" -> {"Jubilee"}, "Canary Wharf" -> {"Jubilee"}, "Canning Town" -> {"Jubilee"}, "Cannon Street" -> {"Circle", "District"}, "Canons Park" -> {"Jubilee"}, "Chalfont & Latimer" -> {"Metropolitan"}, "Chalk Farm" -> {"Northern"}, "Chancery Lane" -> {"Central"}, "Charing Cross" -> {"Bakerloo", "Northern"}, "Chesham" -> {"Metropolitan"}, "Chigwell" -> {"Central"}, "Chiswick Park" -> {"District"}, "Chorleywood" -> {"Metropolitan"}, "Clapham Common" -> {"Northern"}, "Clapham North" -> {"Northern"}, "Clapham South" -> {"Northern"}, "Cockfosters" -> {"Piccadilly"}, "Colindale" -> {"Northern"}, "Colliers Wood" -> {"Northern"}, "Covent Garden" -> {"Piccadilly"}, "Croxley" -> {"Metropolitan"}, "Dagenham East" -> {"District"}, "Dagenham Heathway" -> {"District"}, "Debden" -> {"Central"}, "Dollis Hill" -> {"Jubilee"}, "Ealing Broadway" -> {"Central", "District"}, "Ealing Common" -> {"District", "Piccadilly"}, "Earl's Court" -> {"District", "Piccadilly"}, "East Acton" -> {"Central"}, "East Finchley" -> {"Northern"}, "East Ham" -> {"District", "Hammersmith & City"}, "East Putney" -> {"District"}, "Eastcote" -> {"Metropolitan", "Piccadilly"}, "Edgware" -> {"Northern"}, "Edgware Road" -> {"Bakerloo", "Circle", "District", "Hammersmith & City"}, "Elephant & Castle" -> {"Bakerloo", "Northern"}, "Elm Park" -> {"District"}, "Embankment" -> {"Bakerloo", "Circle", "District", "Northern"}, "Epping" -> {"Central"}, "Euston" -> {"Northern", "Victoria"}, "Euston Square" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Fairlop" -> {"Central"}, "Farringdon" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Finchley Central" -> {"Northern"}, "Finchley Road" -> {"Jubilee", "Metropolitan"}, "Finsbury Park" -> {"Piccadilly", "Victoria"}, "Fulham Broadway" -> {"District"}, "Gants Hill" -> {"Central"}, "Gloucester Road" -> {"Circle", "District", "Piccadilly"}, "Golders Green" -> {"Northern"}, "Goldhawk Road" -> {"Circle", "Hammersmith & City"}, "Goodge Street" -> {"Northern"}, "Grange Hill" -> {"Central"}, "Great Portland Street" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Greenford" -> {"Central"}, "Green Park" -> {"Jubilee", "Piccadilly", "Victoria"}, "Gunnersbury" -> {"District"}, "Hainault" -> {"Central"}, "Hammersmith" -> {"Circle", "District", "Hammersmith & City", "Piccadilly"}, "Hampstead" -> {"Northern"}, "Hanger Lane" -> {"Central"}, "Harlesden" -> {"Bakerloo"}, "Harrow & Wealdstone" -> {"Bakerloo"}, "Harrow-on-the-Hill" -> {"Metropolitan"}, "Hatton Cross" -> {"Piccadilly"}, "Heathrow Terminals 1, 2, 3" -> {"Piccadilly"}, "Heathrow Terminal 4" -> {"Piccadilly"}, "Heathrow Terminal 5" -> {"Piccadilly"}, "Hendon Central" -> {"Northern"}, "High Barnet" -> {"Northern"}, "Highbury & Islington" -> {"Victoria"}, "Highgate" -> {"Northern"}, "High Street Kensington" -> {"Circle", "District"}, "Hillingdon" -> {"Metropolitan", "Piccadilly"}, "Holborn" -> {"Central", "Piccadilly"}, "Holland Park" -> {"Central"}, "Holloway Road" -> {"Piccadilly"}, "Hornchurch" -> {"District"}, "Hounslow Central" -> {"Piccadilly"}, "Hounslow East" -> {"Piccadilly"}, "Hounslow West" -> {"Piccadilly"}, "Hyde Park Corner" -> {"Piccadilly"}, "Ickenham" -> {"Metropolitan", "Piccadilly"}, "Kennington" -> {"Northern"}, "Kensal Green" -> {"Bakerloo"}, "Kensington (Olympia)" -> {"District"}, "Kentish Town" -> {"Northern"}, "Kenton" -> {"Bakerloo"}, "Kew Gardens" -> {"District"}, "Kilburn" -> {"Jubilee"}, "Kilburn Park" -> {"Bakerloo"}, "Kingsbury" -> {"Jubilee"}, "King's Cross St. Pancras" -> {"Circle", "Hammersmith & City", "Metropolitan", "Northern", "Piccadilly", "Victoria"}, "Knightsbridge" -> {"Piccadilly"}, "Ladbroke Grove" -> {"Circle", "Hammersmith & City"}, "Lambeth North" -> {"Bakerloo"}, "Lancaster Gate" -> {"Central"}, "Latimer Road" -> {"Circle", "Hammersmith & City"}, "Leicester Square" -> {"Northern", "Piccadilly"}, "Leyton" -> {"Central"}, "Leytonstone" -> {"Central"}, "Liverpool Street" -> {"Central", "Circle", "Hammersmith & City", "Metropolitan"}, "London Bridge" -> {"Jubilee", "Northern"}, "Loughton" -> {"Central"}, "Maida Vale" -> {"Bakerloo"}, "Manor House" -> {"Piccadilly"}, "Mansion House" -> {"Circle", "District"}, "Marble Arch" -> {"Central"}, "Marylebone" -> {"Bakerloo"}, "Mile End" -> {"Central", "District", "Hammersmith & City"}, "Mill Hill East" -> {"Northern"}, "Monument" -> {"Circle", "District"}, "Moorgate" -> {"Circle", "Hammersmith & City", "Metropolitan", "Northern"}, "Moor Park" -> {"Metropolitan"}, "Morden" -> {"Northern"}, "Mornington Crescent" -> {"Northern"}, "Neasden" -> {"Jubilee"}, "Newbury Park" -> {"Central"}, "North Acton" -> {"Central"}, "North Ealing" -> {"Piccadilly"}, "North Greenwich" -> {"Jubilee"}, "North Harrow" -> {"Metropolitan"}, "North Wembley" -> {"Bakerloo"}, "Northfields" -> {"Piccadilly"}, "Northolt" -> {"Central"}, "Northwick Park" -> {"Metropolitan"}, "Northwood" -> {"Metropolitan"}, "Northwood Hills" -> {"Metropolitan"}, "Notting Hill Gate" -> {"Central", "Circle", "District"}, "Oakwood" -> {"Piccadilly"}, "Old Street" -> {"Northern"}, "Osterley" -> {"Piccadilly"}, "Oval" -> {"Northern"}, "Oxford Circus" -> {"Bakerloo", "Central", "Victoria"}, "Paddington" -> {"Bakerloo", "Circle", "District", "Hammersmith & City"}, "Park Royal" -> {"Piccadilly"}, "Parsons Green" -> {"District"}, "Perivale" -> {"Central"}, "Piccadilly Circus" -> {"Bakerloo", "Piccadilly"}, "Pimlico" -> {"Victoria"}, "Pinner" -> {"Metropolitan"}, "Plaistow" -> {"District", "Hammersmith & City"}, "Preston Road" -> {"Metropolitan"}, "Putney Bridge" -> {"District"}, "Queen's Park" -> {"Bakerloo"}, "Queensbury" -> {"Jubilee"}, "Queensway" -> {"Central"}, "Ravenscourt Park" -> {"District"}, "Rayners Lane" -> {"Metropolitan", "Piccadilly"}, "Redbridge" -> {"Central"}, "Regent's Park" -> {"Bakerloo"}, "Richmond" -> {"District"}, "Rickmansworth" -> {"Metropolitan"}, "Roding Valley" -> {"Central"}, "Royal Oak" -> {"Circle", "Hammersmith & City"}, "Ruislip" -> {"Metropolitan", "Piccadilly"}, "Ruislip Gardens" -> {"Central"}, "Ruislip Manor" -> {"Metropolitan", "Piccadilly"}, "Russell Square" -> {"Piccadilly"}, "St. James's Park" -> {"Circle", "District"}, "St. John's Wood" -> {"Jubilee"}, "St. Paul's" -> {"Central"}, "Seven Sisters" -> {"Victoria"}, "Shepherd's Bush" -> {"Central"}, "Shepherd's Bush Market" -> {"Circle", "Hammersmith & City"}, "Sloane Square" -> {"Circle", "District"}, "Snaresbrook" -> {"Central"}, "South Ealing" -> {"Piccadilly"}, "South Harrow" -> {"Piccadilly"}, "South Kensington" -> {"Circle", "District", "Piccadilly"}, "South Kenton" -> {"Bakerloo"}, "South Ruislip" -> {"Central"}, "South Wimbledon" -> {"Northern"}, "South Woodford" -> {"Central"}, "Southfields" -> {"District"}, "Southgate" -> {"Piccadilly"}, "Southwark" -> {"Jubilee"}, "Stamford Brook" -> {"District"}, "Stanmore" -> {"Jubilee"}, "Stepney Green" -> {"District", "Hammersmith & City"}, "Stockwell" -> {"Northern", "Victoria"}, "Stonebridge Park" -> {"Bakerloo"}, "Stratford" -> {"Central", "Jubilee"}, "Sudbury Hill" -> {"Piccadilly"}, "Sudbury Town" -> {"Piccadilly"}, "Swiss Cottage" -> {"Jubilee"}, "Temple" -> {"Circle", "District"}, "Theydon Bois" -> {"Central"}, "Tooting Bec" -> {"Northern"}, "Tooting Broadway" -> {"Northern"}, "Tottenham Court Road" -> {"Central", "Northern"}, "Tottenham Hale" -> {"Victoria"}, "Totteridge & Whetstone" -> {"Northern"}, "Tower Hill" -> {"Circle", "District"}, "Tufnell Park" -> {"Northern"}, "Turnham Green" -> {"District", "Piccadilly"}, "Turnpike Lane" -> {"Piccadilly"}, "Upminster" -> {"District"}, "Upminster Bridge" -> {"District"}, "Upney" -> {"District"}, "Upton Park" -> {"District", "Hammersmith & City"}, "Uxbridge" -> {"Metropolitan", "Piccadilly"}, "Vauxhall" -> {"Victoria"}, "Victoria" -> {"Circle", "District", "Victoria"}, "Walthamstow Central" -> {"Victoria"}, "Wanstead" -> {"Central"}, "Warren Street" -> {"Northern", "Victoria"}, "Warwick Avenue" -> {"Bakerloo"}, "Waterloo" -> {"Bakerloo", "Jubilee", "Northern", "Waterloo & City"}, "Watford" -> {"Metropolitan"}, "Wembley Central" -> {"Bakerloo"}, "Wembley Park" -> {"Jubilee", "Metropolitan"}, "West Acton" -> {"Central"}, "West Brompton" -> {"District"}, "West Finchley" -> {"Northern"}, "West Ham" -> {"District", "Hammersmith & City", "Jubilee"}, "West Hampstead" -> {"Jubilee"}, "West Harrow" -> {"Metropolitan"}, "West Kensington" -> {"District"}, "West Ruislip" -> {"Central"}, "Westbourne Park" -> {"Circle", "Hammersmith & City"}, "Westminster" -> {"Circle", "District", "Jubilee"}, "White City" -> {"Central"}, "Whitechapel" -> {"District", "Hammersmith & City"}, "Willesden Green" -> {"Jubilee"}, "Willesden Junction" -> {"Bakerloo"}, "Wimbledon" -> {"District"}, "Wimbledon Park" -> {"District"}, "Wood Green" -> {"Piccadilly"}, "Wood Lane" -> {"Circle", "Hammersmith & City"}, "Woodford" -> {"Central"}, "Woodside Park" -> {"Northern"}|>;

KeyValueMap[{#, f[#] == #2} &, testData] // Grid

1
言語には実際に必要なドキュメントが同梱されていますか?そうでない場合は、タイトルを「Mathematica 8+(with <ドキュメント名>)」にすることをお勧めします。間違いなく境界線のuse-of-external-resourceですが、多くの努力が費やされています(特にノートブックが古くなっているため)。
ジョナサンアラン

はい、Mathematicaは実際にドキュメントとともに出荷されます。
hftf

言語にデフォルトでこのすべてのサンプルファイルが付属している場合、抜け穴は使用されていないと思います(Mathematicaは無料ではないため、確認できません。いずれにせよ、素晴らしい答えです!
ジョナサンアラン

16

ES6、のNode.js /クロム、989の 977 931 892 889 887バイト

s=>"Bakerloo,Central,Circle,District,Hammersmith & City,Jubilee,Metropolitan,Northern,Piccadilly,Victoria,Waterloo & City".split`,`.filter((_,i)=>parseInt('7c1w0o741s3k39w22c020c080we80y3l0a8w0t3xhs2olc7g0km87w0176r8ao2e4g0q5w0eeb753mekwx1k18'.substr(" 5Kd5_9 5c4^5];`3]3 4]4^<`Y`0^5h3 9 ;<K 9^2b<`3 Wf9 9`E 0<a;< ; 9`;]2o4b99a33d5`; 3`3jB]Kj9b55e8m5]= KmS ;]K5`9^9]<_3^0 ;]3_3]3 99;b=]K 3 Xe95`9_Qd5_0o3b;];bKf=e=b3jH_<]4d; 3g:d45eT]J_5Kk4{2q9_Kc4c<l9vD`9; 9eIc2^D]<]5a3d8`5hF 4jKhLUm3|5]: ;a5{<> :^3d5t9]5l6_A~f9h5]5b5b9hK]9]: 5l4:a5m9}4^@oHkH^3e3c1c4nBf<bHa:w=b;]AsDl; K`H~K]3d;f8r9 4n9eV]9 <^9~3n=l<]9]5]5a9kK 5 5`: =g:aHcAb2q?_2b0tAsNc;]9]9_3e5e3qAkR^Ac5bK Mc?a;9t=y2_;]5b3_2e<vOd4_9i;^C`9w;a3p:a<j9]5 7Ke:_<3 9`5_Ga4h9t8_9^>e3]H^Eg5zAe4cZ_;ePGm2 3a3".replace(/./g,c=>c.repeat((n=c[C='charCodeAt']())<92||n-91))[C](parseInt(s.replace(/\W|\d/g,''),36)*79%2777%2328)*2-96,2),36)>>i&1)

完全なテストスイート(Node.js)

オンラインでお試しください!

デモ(Chrome)

注意parseInt()ブラウザー間の実装の不整合により(1)、これはChrome上のすべてのステーションでのみ機能することが保証されています。

(1)仕様から:mathIntを、基数R表記[...]のZで表される数学的な整数値とする。Rが2、4、8、10、16、または32でない場合、mathIntは、基数R表記のZで表される数学的な整数値の実装依存の近似値です。


どうやって?

以下は、inputの段階的なデコードの例ですs = "St. James's Park"

ステップ1

最初に、すべてのパディング文字を展開して、プライマリルックアップテーブル(503バイトから2,328バイト)を拡張します。これらの文字は92を超えるASCIIコードでエンコードされますが、ペイロードデータは48〜90の範囲を使用します。

tbl = " 5Kd5_9 5c4[...]"
  .replace(
    /./g, c =>
      c.repeat((n = c.charCodeAt()) < 92 || n - 91)
  )

ステップ2

入力文字列からアルファベット以外の文字をすべて削除します。

str = s.replace(/\W|\d/g, '')

を与える"StJamessPark"

ステップ#3

結果の文字列をbase-36の量として解析します。

id = parseInt(str, 36)

これは3793395908848905700(これはChrome V8によって返される近似結果です)。

ステップ#4

ハッシュ値を計算します:

hash = id * 79 % 2777 % 2328

を与える533

注意:精度が失われるため、この結果は数学的に正確ではありません(そうでなければなりません184)。しかし、ルックアップテーブルは-もちろん-同じように構築されていたので、それが私たちが期待しているものです。

ステップ#5

プライマリルックアップテーブルのこの位置にある文字のASCIIコードを取得します。

code = tbl.charCodeAt(hash)

これは58(これが文字':')を与えます。

ステップ6

この値を使用して、セカンダリルックアップテーブルから2文字の文字列を抽出します。

msk36 = '7c1w0o74[...]'.substr(code * 2 - 96, 2)

を与える0c

ステップ7

この文字列をbase-36の量として解析します。

msk = parseInt(msk36, 36)

を与える12

ステップ#8

最後に、で設定されたビットに従ってステーションリストをフィルタリングし、msk最下位のものから開始します。

"Bakerloo,Central,Circle,District,[...]".split`,`.filter((_, i) => msk >> i & 1)

この例でmskは、hold 1200000001100バイナリです。そのため、3番目と4番目のステーションを保持し、最終結果を導きます[ 'Circle', 'District' ]


@JonathanAllanそうではない?私にとってそれは戻りますNorthern
エリックアウトゴルファー

RegPackを使用してスクリプトを圧縮すると、3バイト節約できます。

@ThePirateBay(更新)メインデータ文字列を再エンコードすることで46バイトを節約したため、RegPackフレンドリではなくなりました。
アーナルド

興味深いことに、あなたが参照する矛盾は何ですか?
ニール

1
@Neil 仕様からmathIntを、基数R表記[...]でZによって表される数学的な整数値とする。Rが2、4、8、10、16、または32でない場合、mathIntは、基数R表記のZで表される数学的な整数値の実装依存の近似値です。
アーナウルド

5

Kotlin2271 2270 2000 1694バイト

{x->val r=java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
var I=java.util.zip.Inflater()
I.setInput(r)
I.finished()
var o=ByteArray(1846)
I.inflate(o)
var v=String(o).split("~")
Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).filter{x.hashCode()%2897==it.groupValues[1].toInt()}.map{it.groupValues[2].map{v[0].split("|")[it-'A']}}.first()}

美化

{x->
    // Parses the data line into groups of <hashcode % 2897, and line numbers within the list below as letters
    val r = java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
    var I = java.util.zip.Inflater()
    I.setInput(r)
    I.finished()
    var o = ByteArray(1846)
    I.inflate(o)
    var v= String(o).split("~")
    Regex("(-?[0-9]+)([A-Z]+)")
            // Finds all the groups
            .findAll(v[1])// Gets the right group
            .filter{ x.hashCode()%2897==it.groupValues[1].toInt()}
            // Gets each letter and turns it into a station name
            .map{
                it.groupValues[2].map{
                    v[0]
                            .split("|")[it-'A']}}.first()
}

テスト

var v:(String)->List<String> =
{x->val r=java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
var I=java.util.zip.Inflater()
I.setInput(r)
I.finished()
var o=ByteArray(1846)
I.inflate(o)
var v=String(o).split("~")
Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).filter{x.hashCode()%2897==it.groupValues[1].toInt()}.map{it.groupValues[2].map{v[0].split("|")[it-'A']}}.first()}
data class TestData(val name: String, val lines: List<String>)

fun main(args: Array<String>) {
    var items = listOf(
            TestData("Acton Town", listOf("District", "Piccadilly")),
            TestData("Aldgate", listOf("Circle", "Metropolitan")),
            TestData("Aldgate East", listOf("District", "Hammersmith & City")),
            TestData("Alperton", listOf("Piccadilly")),
            TestData("Amersham", listOf("Metropolitan")),
            TestData("Angel", listOf("Northern")),
            TestData("Archway", listOf("Northern")),
            TestData("Arnos Grove", listOf("Piccadilly")),
            TestData("Arsenal", listOf("Piccadilly")),
            TestData("Baker Street", listOf("Bakerloo", "Circle", "Hammersmith & City", "Jubilee", "Metropolitan")),
            TestData("Balham", listOf("Northern")),
            TestData("Bank", listOf("Central", "Northern", "Waterloo & City")),
            TestData("Barbican", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Barking", listOf("District", "Hammersmith & City")),
            TestData("Barkingside", listOf("Central")),
            TestData("Barons Court", listOf("District", "Piccadilly")),
            TestData("Bayswater", listOf("Circle", "District")),
            TestData("Becontree", listOf("District")),
            TestData("Belsize Park", listOf("Northern")),
            TestData("Bermondsey", listOf("Jubilee")),
            TestData("Bethnal Green", listOf("Central")),
            TestData("Blackfriars", listOf("Circle", "District")),
            TestData("Blackhorse Road", listOf("Victoria")),
            TestData("Bond Street", listOf("Central", "Jubilee")),
            TestData("Borough", listOf("Northern")),
            TestData("Boston Manor", listOf("Piccadilly")),
            TestData("Bounds Green", listOf("Piccadilly")),
            TestData("Bow Road", listOf("District", "Hammersmith & City")),
            TestData("Brent Cross", listOf("Northern")),
            TestData("Brixton", listOf("Victoria")),
            TestData("Bromley-by-Bow", listOf("District", "Hammersmith & City")),
            TestData("Buckhurst Hill", listOf("Central")),
            TestData("Burnt Oak", listOf("Northern")),
            TestData("Caledonian Road", listOf("Piccadilly")),
            TestData("Camden Town", listOf("Northern")),
            TestData("Canada Water", listOf("Jubilee")),
            TestData("Canary Wharf", listOf("Jubilee")),
            TestData("Canning Town", listOf("Jubilee")),
            TestData("Cannon Street", listOf("Circle", "District")),
            TestData("Canons Park", listOf("Jubilee")),
            TestData("Chalfont & Latimer", listOf("Metropolitan")),
            TestData("Chalk Farm", listOf("Northern")),
            TestData("Chancery Lane", listOf("Central")),
            TestData("Charing Cross", listOf("Bakerloo", "Northern")),
            TestData("Chesham", listOf("Metropolitan")),
            TestData("Chigwell", listOf("Central")),
            TestData("Chiswick Park", listOf("District")),
            TestData("Chorleywood", listOf("Metropolitan")),
            TestData("Clapham Common", listOf("Northern")),
            TestData("Clapham North", listOf("Northern")),
            TestData("Clapham South", listOf("Northern")),
            TestData("Cockfosters", listOf("Piccadilly")),
            TestData("Colindale", listOf("Northern")),
            TestData("Colliers Wood", listOf("Northern")),
            TestData("Covent Garden", listOf("Piccadilly")),
            TestData("Croxley", listOf("Metropolitan")),
            TestData("Dagenham East", listOf("District")),
            TestData("Dagenham Heathway", listOf("District")),
            TestData("Debden", listOf("Central")),
            TestData("Dollis Hill", listOf("Jubilee")),
            TestData("Ealing Broadway", listOf("Central", "District")),
            TestData("Ealing Common", listOf("District", "Piccadilly")),
            TestData("Earl's Court", listOf("District", "Piccadilly")),
            TestData("East Acton", listOf("Central")),
            TestData("East Finchley", listOf("Northern")),
            TestData("East Ham", listOf("District", "Hammersmith & City")),
            TestData("East Putney", listOf("District")),
            TestData("Eastcote", listOf("Metropolitan", "Piccadilly")),
            TestData("Edgware", listOf("Northern")),
            TestData("Edgware Road", listOf("Bakerloo", "Circle", "District", "Hammersmith & City")),
            TestData("Elephant & Castle", listOf("Bakerloo", "Northern")),
            TestData("Elm Park", listOf("District")),
            TestData("Embankment", listOf("Bakerloo", "Circle", "District", "Northern")),
            TestData("Epping", listOf("Central")),
            TestData("Euston", listOf("Northern", "Victoria")),
            TestData("Euston Square", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Fairlop", listOf("Central")),
            TestData("Farringdon", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Finchley Central", listOf("Northern")),
            TestData("Finchley Road", listOf("Jubilee", "Metropolitan")),
            TestData("Finsbury Park", listOf("Piccadilly", "Victoria")),
            TestData("Fulham Broadway", listOf("District")),
            TestData("Gants Hill", listOf("Central")),
            TestData("Gloucester Road", listOf("Circle", "District", "Piccadilly")),
            TestData("Golders Green", listOf("Northern")),
            TestData("Goldhawk Road", listOf("Circle", "Hammersmith & City")),
            TestData("Goodge Street", listOf("Northern")),
            TestData("Grange Hill", listOf("Central")),
            TestData("Great Portland Street", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Greenford", listOf("Central")),
            TestData("Green Park", listOf("Jubilee", "Piccadilly", "Victoria")),
            TestData("Gunnersbury", listOf("District")),
            TestData("Hainault", listOf("Central")),
            TestData("Hammersmith", listOf("Circle", "District", "Hammersmith & City", "Piccadilly")),
            TestData("Hampstead", listOf("Northern")),
            TestData("Hanger Lane", listOf("Central")),
            TestData("Harlesden", listOf("Bakerloo")),
            TestData("Harrow & Wealdstone", listOf("Bakerloo")),
            TestData("Harrow-on-the-Hill", listOf("Metropolitan")),
            TestData("Hatton Cross", listOf("Piccadilly")),
            TestData("Heathrow Terminals 1, 2, 3", listOf("Piccadilly")),
            TestData("Heathrow Terminal 4", listOf("Piccadilly")),
            TestData("Heathrow Terminal 5", listOf("Piccadilly")),
            TestData("Hendon Central", listOf("Northern")),
            TestData("High Barnet", listOf("Northern")),
            TestData("Highbury & Islington", listOf("Victoria")),
            TestData("Highgate", listOf("Northern")),
            TestData("High Street Kensington", listOf("Circle", "District")),
            TestData("Hillingdon", listOf("Metropolitan", "Piccadilly")),
            TestData("Holborn", listOf("Central", "Piccadilly")),
            TestData("Holland Park", listOf("Central")),
            TestData("Holloway Road", listOf("Piccadilly")),
            TestData("Hornchurch", listOf("District")),
            TestData("Hounslow Central", listOf("Piccadilly")),
            TestData("Hounslow East", listOf("Piccadilly")),
            TestData("Hounslow West", listOf("Piccadilly")),
            TestData("Hyde Park Corner", listOf("Piccadilly")),
            TestData("Ickenham", listOf("Metropolitan", "Piccadilly")),
            TestData("Kennington", listOf("Northern")),
            TestData("Kensal Green", listOf("Bakerloo")),
            TestData("Kensington (Olympia)", listOf("District")),
            TestData("Kentish Town", listOf("Northern")),
            TestData("Kenton", listOf("Bakerloo")),
            TestData("Kew Gardens", listOf("District")),
            TestData("Kilburn", listOf("Jubilee")),
            TestData("Kilburn Park", listOf("Bakerloo")),
            TestData("Kingsbury", listOf("Jubilee")),
            TestData("King's Cross St. Pancras", listOf("Circle", "Hammersmith & City", "Metropolitan", "Northern", "Piccadilly", "Victoria")),
            TestData("Knightsbridge", listOf("Piccadilly")),
            TestData("Ladbroke Grove", listOf("Circle", "Hammersmith & City")),
            TestData("Lambeth North", listOf("Bakerloo")),
            TestData("Lancaster Gate", listOf("Central")),
            TestData("Latimer Road", listOf("Circle", "Hammersmith & City")),
            TestData("Leicester Square", listOf("Northern", "Piccadilly")),
            TestData("Leyton", listOf("Central")),
            TestData("Leytonstone", listOf("Central")),
            TestData("Liverpool Street", listOf("Central", "Circle", "Hammersmith & City", "Metropolitan")),
            TestData("London Bridge", listOf("Jubilee", "Northern")),
            TestData("Loughton", listOf("Central")),
            TestData("Maida Vale", listOf("Bakerloo")),
            TestData("Manor House", listOf("Piccadilly")),
            TestData("Mansion House", listOf("Circle", "District")),
            TestData("Marble Arch", listOf("Central")),
            TestData("Marylebone", listOf("Bakerloo")),
            TestData("Mile End", listOf("Central", "District", "Hammersmith & City")),
            TestData("Mill Hill East", listOf("Northern")),
            TestData("Monument", listOf("Circle", "District")),
            TestData("Moorgate", listOf("Circle", "Hammersmith & City", "Metropolitan", "Northern")),
            TestData("Moor Park", listOf("Metropolitan")),
            TestData("Morden", listOf("Northern")),
            TestData("Mornington Crescent", listOf("Northern")),
            TestData("Neasden", listOf("Jubilee")),
            TestData("Newbury Park", listOf("Central")),
            TestData("North Acton", listOf("Central")),
            TestData("North Ealing", listOf("Piccadilly")),
            TestData("North Greenwich", listOf("Jubilee")),
            TestData("North Harrow", listOf("Metropolitan")),
            TestData("North Wembley", listOf("Bakerloo")),
            TestData("Northfields", listOf("Piccadilly")),
            TestData("Northolt", listOf("Central")),
            TestData("Northwick Park", listOf("Metropolitan")),
            TestData("Northwood", listOf("Metropolitan")),
            TestData("Northwood Hills", listOf("Metropolitan")),
            TestData("Notting Hill Gate", listOf("Central", "Circle", "District")),
            TestData("Oakwood", listOf("Piccadilly")),
            TestData("Old Street", listOf("Northern")),
            TestData("Osterley", listOf("Piccadilly")),
            TestData("Oval", listOf("Northern")),
            TestData("Oxford Circus", listOf("Bakerloo", "Central", "Victoria")),
            TestData("Paddington", listOf("Bakerloo", "Circle", "District", "Hammersmith & City")),
            TestData("Park Royal", listOf("Piccadilly")),
            TestData("Parsons Green", listOf("District")),
            TestData("Perivale", listOf("Central")),
            TestData("Piccadilly Circus", listOf("Bakerloo", "Piccadilly")),
            TestData("Pimlico", listOf("Victoria")),
            TestData("Pinner", listOf("Metropolitan")),
            TestData("Plaistow", listOf("District", "Hammersmith & City")),
            TestData("Preston Road", listOf("Metropolitan")),
            TestData("Putney Bridge", listOf("District")),
            TestData("Queen's Park", listOf("Bakerloo")),
            TestData("Queensbury", listOf("Jubilee")),
            TestData("Queensway", listOf("Central")),
            TestData("Ravenscourt Park", listOf("District")),
            TestData("Rayners Lane", listOf("Metropolitan", "Piccadilly")),
            TestData("Redbridge", listOf("Central")),
            TestData("Regent's Park", listOf("Bakerloo")),
            TestData("Richmond", listOf("District")),
            TestData("Rickmansworth", listOf("Metropolitan")),
            TestData("Roding Valley", listOf("Central")),
            TestData("Royal Oak", listOf("Circle", "Hammersmith & City")),
            TestData("Ruislip", listOf("Metropolitan", "Piccadilly")),
            TestData("Ruislip Gardens", listOf("Central")),
            TestData("Ruislip Manor", listOf("Metropolitan", "Piccadilly")),
            TestData("Russell Square", listOf("Piccadilly")),
            TestData("St. James's Park", listOf("Circle", "District")),
            TestData("St. John's Wood", listOf("Jubilee")),
            TestData("St. Paul's", listOf("Central")),
            TestData("Seven Sisters", listOf("Victoria")),
            TestData("Shepherd's Bush", listOf("Central")),
            TestData("Shepherd's Bush Market", listOf("Circle", "Hammersmith & City")),
            TestData("Sloane Square", listOf("Circle", "District")),
            TestData("Snaresbrook", listOf("Central")),
            TestData("South Ealing", listOf("Piccadilly")),
            TestData("South Harrow", listOf("Piccadilly")),
            TestData("South Kensington", listOf("Circle", "District", "Piccadilly")),
            TestData("South Kenton", listOf("Bakerloo")),
            TestData("South Ruislip", listOf("Central")),
            TestData("South Wimbledon", listOf("Northern")),
            TestData("South Woodford", listOf("Central")),
            TestData("Southfields", listOf("District")),
            TestData("Southgate", listOf("Piccadilly")),
            TestData("Southwark", listOf("Jubilee")),
            TestData("Stamford Brook", listOf("District")),
            TestData("Stanmore", listOf("Jubilee")),
            TestData("Stepney Green", listOf("District", "Hammersmith & City")),
            TestData("Stockwell", listOf("Northern", "Victoria")),
            TestData("Stonebridge Park", listOf("Bakerloo")),
            TestData("Stratford", listOf("Central", "Jubilee")),
            TestData("Sudbury Hill", listOf("Piccadilly")),
            TestData("Sudbury Town", listOf("Piccadilly")),
            TestData("Swiss Cottage", listOf("Jubilee")),
            TestData("Temple", listOf("Circle", "District")),
            TestData("Theydon Bois", listOf("Central")),
            TestData("Tooting Bec", listOf("Northern")),
            TestData("Tooting Broadway", listOf("Northern")),
            TestData("Tottenham Court Road", listOf("Central", "Northern")),
            TestData("Tottenham Hale", listOf("Victoria")),
            TestData("Totteridge & Whetstone", listOf("Northern")),
            TestData("Tower Hill", listOf("Circle", "District")),
            TestData("Tufnell Park", listOf("Northern")),
            TestData("Turnham Green", listOf("District", "Piccadilly")),
            TestData("Turnpike Lane", listOf("Piccadilly")),
            TestData("Upminster", listOf("District")),
            TestData("Upminster Bridge", listOf("District")),
            TestData("Upney", listOf("District")),
            TestData("Upton Park", listOf("District", "Hammersmith & City")),
            TestData("Uxbridge", listOf("Metropolitan", "Piccadilly")),
            TestData("Vauxhall", listOf("Victoria")),
            TestData("Victoria", listOf("Circle", "District", "Victoria")),
            TestData("Walthamstow Central", listOf("Victoria")),
            TestData("Wanstead", listOf("Central")),
            TestData("Warren Street", listOf("Northern", "Victoria")),
            TestData("Warwick Avenue", listOf("Bakerloo")),
            TestData("Waterloo", listOf("Bakerloo", "Jubilee", "Northern", "Waterloo & City")),
            TestData("Watford", listOf("Metropolitan")),
            TestData("Wembley Central", listOf("Bakerloo")),
            TestData("Wembley Park", listOf("Jubilee", "Metropolitan")),
            TestData("West Acton", listOf("Central")),
            TestData("West Brompton", listOf("District")),
            TestData("West Finchley", listOf("Northern")),
            TestData("West Ham", listOf("District", "Hammersmith & City", "Jubilee")),
            TestData("West Hampstead", listOf("Jubilee")),
            TestData("West Harrow", listOf("Metropolitan")),
            TestData("West Kensington", listOf("District")),
            TestData("West Ruislip", listOf("Central")),
            TestData("Westbourne Park", listOf("Circle", "Hammersmith & City")),
            TestData("Westminster", listOf("Circle", "District", "Jubilee")),
            TestData("White City", listOf("Central")),
            TestData("Whitechapel", listOf("District", "Hammersmith & City")),
            TestData("Willesden Green", listOf("Jubilee")),
            TestData("Willesden Junction", listOf("Bakerloo")),
            TestData("Wimbledon", listOf("District")),
            TestData("Wimbledon Park", listOf("District")),
            TestData("Wood Green", listOf("Piccadilly")),
            TestData("Wood Lane", listOf("Circle", "Hammersmith & City")),
            TestData("Woodford", listOf("Central")),
            TestData("Woodside Park", listOf("Northern"))
    )

    var good = 0
    var bad = 0

    for (item in items) {
        var out = v(item.name);
        if (item.lines == out) {
            good++
        } else {
            bad++
        }
    }
    println("Results: G $good B $bad")
}

編集

不要なパイプ区切り文字-270バイトを削除

zipツールで圧縮-306バイト


1
TIL:ウッドサイド・パークは1337です
ジョナサン・アラン

文字列を圧縮するためにJavaのZIPツールを使用してみると、より多くのビットダウンのバイト数を取得する必要があります
jrtapsell

5

パイソン22309の 2301 2218バイト

lambda I,p="Woods|Woodf|Wood L|Wo|Wimbledon |Wim|Willesden J|Wi|Whitec|Wh|Westm|Westb|West R|West K|West Har|West Hamp|West H|West F|West B|Wes|Wembley P|We|Watf|Wat|Warw|War|Wan|W|Vi|V|Ux|Upt|Upn|Upminster |U|Turnp|Tur|Tu|Tow|Totter|Tottenham H|Tot|Tooting Br|To|Th|T|Sw|Sudbury T|Su|Str|Ston|Sto|Ste|Stan|Sta|St. P|St. Jo|St|Southw|Southg|Southf|South Wo|South W|South R|South Kent|South K|South H|So|Sn|Sl|Shepherd's Bush |Sh|S|Rus|Ruislip M|Ruislip |Ru|Roy|Ro|Rick|Ri|Reg|Re|Ray|R|Queensw|Queens|Q|Pu|Pr|Pl|Pin|Pim|Pi|Pe|Pars|Par|P|Ox|Ov|Os|Ol|O|Not|Northwood |Northwo|Northw|Northo|Northf|North W|North H|North G|North E|No|New|N|Morn|Mor|Moorg|Moo|Mo|Mill|Mi|Mary|Mar|Mans|Man|M|Lou|Lo|Li|Leytons|Ley|Le|Lat|Lan|Lam|L|Kn|Kings|Kin|Kilburn |Ki|Kew|Kento|Kent|Kensi|Kens|K|I|Hy|Hounslow W|Hounslow E|Hou|Hor|Hollo|Holl|Ho|Hil|Highg|Highb|High S|Hi|Hen|Heathrow Terminals|Heathrow Terminal 5|He|Hat|Harrow-|Harr|Har|Han|Hamp|Ham|H|Gu|Greenf|Gree|Gre|Gr|Goo|Goldh|Go|Gl|G|Fu|Fins|Finchley R|Fi|Far|F|Euston |Eu|Ep|Em|Elm|El|Edgware |Ed|Eastc|East P|East H|East F|Eas|Ear|Ealing C|E|Do|De|Dagenham H|D|Cr|Cov|Coll|Col|Co|Clapham S|Clapham N|Cl|Cho|Chis|Chi|Che|Char|Chan|Chalk|Ch|Cano|Canno|Cann|Canar|Can|Cam|C|Bur|Bu|Bro|Bri|Br|Bow|Bou|Bos|Bor|Bo|Blackh|Bl|Bet|Ber|Bel|Be|Bay|Baro|Barkings|Bark|Bar|Ban|Bal|B|Ars|Arn|Ar|An|Am|Alp|Aldgate |Al|".split('|'):[j for i,j in enumerate('District|Piccadilly|Northern|Central|Circle|Metropolitan|Hammersmith & City|Jubilee|Bakerloo|Victoria|Waterloo & City'.split('|'))if[int(x,35)for x in'4 8 2A 2 1 1 7B 3N 1U 8 45 2A 8 1 W 3N 5I 4 1 8 4K 7B W 15C 7B EQ 8 EM F4 EM Y 1U 1 1 1 2 3 4 H 4 EM C 4 4 8 H 3N 2 2 3V 7B EQ 1U 3N 1 8 3N H 3N 2 1 8 4 8 7B J 2 2 8 H 2A 8 EM 2 Y 8 Y 2A 8 W 1 7B 8 Y 1 8 3N 7B 1 W 1U W EM 7D 8 1 2 9M M6 4 2 4 2 P W W W 8 2 7B W 3N 2 8 8 3N 4 4 3B W H 4 23 7B 8 H 2 7B 8 3R 3F 8 8 6 2A 8 7B 2A 2 3N I0 7B 3N 1 7B 4 1 7B 4 Y 2 2 2 2 1 2 8 A Y 4 EM H 4 4 2 2 2 2 W 7B 7B 8 4 2D 8 1 8 IC 37 8 4 2A 4 J 8 1 EO 4K 4 37 8 37 EQ 8 7W 1 7F 9M 4 Y 1 1U 4 8 3 3 9 3N 8 1 1 W 2 4 4 2 4 4 4 W 1 8 W 7F 8 4 W 3N H 3N 3N 3N 4 2 4 8 1U EM 4 1U 2 2 4 3V EM H 8 3N 4 1 H 3 8 1U 37 TL 4 E6 2 2 4 4 W 2 1U 1D 3'.split()][p.index([x for x in p if I.find(x)==0][0])]&2**i]

オンラインでお試しください!

-6 Mr. Xcoderに感謝します。

長すぎる...たぶんそれはゴルフに適しています。



別の検索方法を使用する1813バイト1498バイト mdahmouneのエンコーディング@使用して
TFeld

1498バイト @EriktheOutgolferどういうわけか間違ったリンクをコピーしました。ここにあります。
TFeld

1
重複(類似した名前と同じ行を持つ複数のステーション)を削除するのを忘れた: 1708バイト1434バイト
TFeld


3

シナモンガム、2100バイト

Hexdump:

0000000: 6c95 594d 77db 3a0e fd2b 5ab9 33e7 3873  l.YMw.:..+Z.3.8s
0000010: ce7c ccaa ab3a 6d93 d797 be66 92bc 7a0d  .|...:m....f..z.
0000020: 4b88 c563 8af4 8054 1ccd af1f 1066 484a  K..c...T.....fHJ
0000030: 4aec 7417 5f80 e025 085c 92ca a7da 5b53  J.t._..%.\....[S
0000040: 3dd8 8359 7c56 ce93 aafd f256 d535 344a  =..Y|V.....V.54J
0000050: ebe1 e327 dd6c c1e3 e252 51ad 71f9 1d3d  ...'.l...RQ.q..=
0000060: d9bd d5ca 8379 b155 5fc0 f93c f81a ba0e  .....y.U_..<....
0000070: c975 cab7 1598 a6ba 543e 84d9 23f1 448b  .u......T>..#.D.
0000080: 3274 706b a15b 8c83 9a2d eac5 1f96 7c8b  2tpk.[...-....|.
0000090: c43f a96e 0f30 9480 b1ae ba22 fb84 a360  .?.n.0....."...`
00000a0: e4d0 802e a115 ec90 aa7b 4f88 7e21 3fb4  .........{O.~!?.
00000b0: b5cb b890 d758 2ebf f51b a571 b2ca 1568  .....X.....q...h
00000c0: 2699 09ac c0ec 1697 683c 815e bea0 cb35  &.......h<.^...5
00000d0: 7889 9f82 b11f 6d54 0d66 7162 c6e9 4cb4  x.....mT.fqb..L.
00000e0: 5366 7b26 95d1 cba9 065f 6804 cc1a 575d  Sf{&....._h...W]
00000f0: da9e 8a9d 18e5 6270 8740 f185 cd8b d3c7  ......bp.@......
0000100: 15d6 d684 1c2d 0a48 3bf5 3fac 6e79 a662  .....-.H;.?.ny.b
0000110: dd48 9d35 8dc3 6111 f3c4 906f 0d68 de0d  .H.5..a....o.h..
0000120: 4493 c968 a877 8fa4 80dc 6c36 b1b5 961c  D..h.w....l6....
0000130: 5677 169a c54f 062d bb7e 5c71 e8b8 5729  Vw...O.-.~\q..W)
0000140: b969 1a4b b6df b605 15eb 42d1 7e07 6369  .i.K......B.~.ci
0000150: b4e3 b667 8291 ce08 3fc8 74e7 324b 3c71  ...g....?.t.2K<q
0000160: 7549 d6b9 622e 52cf 3c59 c194 6ca7 71b8  uI..b.R.<Y..l.q.
0000170: d80c 171c f75c c89e 97db 93f3 d535 33c9  .....\.......53.
0000180: 29ea 8967 fa01 457a 2f41 6363 8d02 2354  )..g..Ez/Acc..#T
0000190: 0bfa 6cea 1a8c 3d5a f81b 68a0 92ba 4b1b  ..l...=Z..h...K.
00001a0: 1240 1aaa 750b f458 8286 0b46 c68f 406b  .@..u..X...F..@k
00001b0: 52c6 27db c456 6b9c 1440 1ed1 827e b44c  R.'..Vk..@...~.L
00001c0: 7b51 dd80 57bc d651 e38a 7d57 7d05 4abd  {Q..W..Q..}W}.J.
00001d0: 2298 a991 061e 6172 b532 4a81 9064 3a77  ".....ar.2J..d:w
00001e0: 6631 0a67 bac0 a0da 1eb0 c821 03ee a0ea  f1.g.......!....
00001f0: dd91 65a6 de5a d238 1cac 6d26 0134 ec39  ..e..Z.8..m&.4.9
0000200: 2a37 49d7 d994 c88c 0b30 87ef 6d3f 822d  *7I......0..m?.-
0000210: d7b6 751e c98d b688 2731 0d68 2c3d b556  ..u.....'1.h,=.V
0000220: ec56 ad99 4a09 3f85 2abb 026a c645 cad9  .V..J.?.*..j.E..
0000230: 7866 e263 d29f 618b 8669 8c35 36c3 d708  xf.c..a..i.56...
0000240: 5ef4 319b 70d3 14cd f839 b070 527d 6927  ^.1.p....9.pR}i'
0000250: bf80 0ee9 e742 8626 8c8d be79 fba3 43cc  .....B.&...y..C.
0000260: d42b 7ac2 1ea4 3f9c 129c c0b7 92b3 2551  .+z...?.......%Q
0000270: 11e8 ab32 75ab b110 7481 b979 ce74 92b8  ...2u...t..y.t..
0000280: ddf6 de60 5eac 80b5 f538 4ada 8846 b33d  ...`^....8J..F.=
0000290: 0015 bb12 01e9 b1d9 a170 8681 46ae 0869  .........p..F..i
00002a0: 804b 9e57 e3bc 74d9 a79b d4e3 976e 0366  .K.W..t......n.f
00002b0: d7a1 f16f 4f97 87ef f79c f89c b1de f9a2  ...oO...........
00002c0: 5497 4983 c4c0 ddfb df1e 08df 7fc0 7c05  T.I...........|.
00002d0: c5f3 ef53 7c6e d6d0 888d 35bf 1023 6e60  ...S|n....5..#n`
00002e0: 1583 2476 d922 b98d c536 1bec 363d 0d92  ..$v."...6..6=..
00002f0: a3a2 f8f3 cabe f6e1 b4cd b599 f278 05c6  .............x..
0000300: bbb1 8a5e 69db d718 7a51 a6cc 2a36 2fc7  ...^i...zQ..*6/.
0000310: 2bab 1ba4 7834 24ca 02b7 70d8 c9f8 5339  +...x4$...p...S9
0000320: 604f db6c 31ea 6511 80c0 303c a645 085c  `O.l1.e...0<.E.\
0000330: aaec a221 1f6a ef4e b050 7cb4 d494 01d1  ...!.j.N.P|.....
0000340: 8cc4 78f9 5aea ae7a 6390 24bf 396d d7a0  ..x.Z..zc.$.9m..
0000350: 0cf4 daa7 6005 81c5 7bca becc 22db f7ce  ....`...{..."...
0000360: 2314 7276 1dd6 4f23 7d67 8c34 ba06 4daa  #.rv..O#}g.4..M.
0000370: f800 913d 70e7 ac11 7413 8a17 a7c6 0b6b  ...=p...t......k
0000380: 2e38 e685 e4b2 cc08 db3d 0f88 c745 4147  .8.......=...EAG
0000390: c42f 847d 40ea 9401 edaa bf2f ab7f 2cab  ./.}@....../..,.
00003a0: 7f9e f4aa fe75 dafc efb1 d934 d6cc 8bfd  .....u.....4....
00003b0: 5a6d db6a 0564 d08f 4129 ef45 f59b 0b12  Zm.j.d..A).E....
00003c0: 5a5e 1cc4 2a77 e991 7fac 8fea 7734 2e8e  Z^..*w......w4..
00003d0: 989e c621 23b1 4ddf d2b9 6bab 3796 92d6  ...!#.M...k.7...
00003e0: 4e4c 5287 523f d12e a03d 40ec d591 3771  NLR.R?...=@...7q
00003f0: 17f7 54b7 450d d9de 3876 4f59 c8fe d916  ..T.E...8vOY....
0000400: a4f8 55c3 1a27 86a1 4121 c3a7 0719 a4d2  ..U..'..A!......
0000410: f65b bd93 73ed cd75 7296 4ccc 52ca 2263  .[..s..ur.L.R."c
0000420: 2e5d 4253 51e5 7c56 7ff9 a187 6eaf e0af  .]BSQ.|V....n...
0000430: 7949 6cf5 cab5 e33b 95a0 7614 e310 0f6a  yIl....;..v....j
0000440: 570c 559a f738 dfa4 e26f 5952 3194 e796  W.U..8...oYR1...
0000450: 56cc 7e8c 7c70 c72a e64d ff1b 0f30 3581  V.~.|p.*.M...05.
0000460: 7bb7 32a4 63e2 d5ee ffdd 7031 79b7 21c5  {.2.c.....p1y.!.
0000470: 3a55 e6f4 069a 0dd9 1dc6 37d3 89d9 d8b5  :U........7.....
0000480: db20 0332 515a 0bc3 a606 91d9 2bf0 b9cd  . .2QZ......+...
0000490: e32d f0bc 76de a08a 321d 0fac f942 82d3  .-..v...2....B..
00004a0: 505c 16e2 4f11 8a8c a927 a4bd b57a fa50  P\..O....'...z.P
00004b0: 78b7 b6de 58e9 e695 2429 8969 daff 9bf0  x...X...$).i....
00004c0: cc28 597c 07d5 40f5 1374 a156 f2ea a8b8  .(Y|..@..t.V....
00004d0: bc5d 99e6 003b 654d 344c 5a98 adb4 d158  .]...;eM4LZ....X
00004e0: 85d7 6c11 9c06 8d1b 6bca e08a bdbe 98a4  ..l.....k.......
00004f0: fda7 b539 b86b 397c a4fd 7221 7fb7 a697  ...9.k9|..r!....
0000500: 2bc7 8c87 b524 1af4 cb45 2743 8f45 5eda  +....$...E'C.E^.
0000510: 1996 8b6c e146 d2a1 22d8 e86a 3405 af3f  ...l.F.."..j4..?
0000520: 105c 83a9 77f8 f741 f472 a44d e25d dc1d  .\..w..A.r.M.]..
0000530: 3376 bc97 1659 8fb8 b4fe 41d5 6d0e 2cf8  3v...Y....A.m.,.
0000540: f160 19f1 8d96 3576 bc1f 434e bcc0 8f0a  .`....5v..CN....
0000550: 75e3 66f1 adf6 6322 f9d9 310f 3d7b 7864  u.f...c"..1.={xd
0000560: 5876 ca4d 8dde f39a c434 6aaf e574 ebf8  Xv.M.....4j..t..
0000570: b528 b10b 763f 7433 bb91 fc08 8d16 9656  .(..v?t3.......V
0000580: fa3d 812e 3c9e c3ed a20a f1fb e2f9 15e7  .=..<...........
0000590: cd8a 720b 4d13 b5f6 d72e ca22 ee77 7628  ..r.M......".wv(
00005a0: 4f0a 419d 35f1 0a96 e5f4 1649 31bd dce5  O.A.5......I1...
00005b0: 79c8 8c62 194d 755a d576 91d9 2a63 a64f  y..b.MuZ.v..*c.O
00005c0: d25b 0d3c cdd9 47fa 2d21 7bc5 77f7 3880  .[.<..G.-!{.w.8.
00005d0: bc37 a25e 64ce ffe9 11cd 0737 917c 4147  .7.^d......7.|AG
00005e0: 9a1f a1e2 8df5 f10e 9e18 a9c3 bb69 fc50  .............i.P
00005f0: 60cb 6098 9a5c a5de 3cff eeb0 890a 9f02  `.`..\..<.......
0000600: e216 8d9f 91b9 e36e e8ac 698a f85c b41d  .......n..i..\..
0000610: 301b 11f7 d132 ef6c d8e8 a073 1a33 55d9  0....2.l...s.3U.
0000620: 41f9 4871 4adc ef7a e5b4 dabf c138 d9d3  A.HqJ..z.....8..
0000630: 399a a247 5ce4 f4c4 68e7 50eb 9783 a3b0  9..G\...h.P.....
0000640: 8413 f41b 74e8 e2d2 6752 270e b6e5 7d92  ....t...gR'...}.
0000650: 1778 da93 e3d1 dbeb 0f99 cb3d f2a6 54f7  .x.........=..T.
0000660: 4a9e f5b9 a4ee 5bdc b748 0d47 58f5 2e0b  J.....[..H.GX...
0000670: f704 e725 d0ee e40d 9fd9 6a0b 06e3 32e6  ...%......j...2.
0000680: 540d a36e 43d6 eef2 24b6 7f55 f118 cfca  T..nC...$..U....
0000690: 36c5 4fdc 2297 aff9 96bd 1dd1 b82f 131e  6.O."......../..
00006a0: 6b15 f4b2 29af 5d62 90d4 0639 29fd 9390  k...).]b...9)...
00006b0: a605 0a28 e7ce 94c5 8173 576c 0d74 a24d  ...(.....sWl.t.M
00006c0: 2b49 45b1 9560 3a4b 5838 e2de e030 d192  +IE..`:KX8...0..
00006d0: 3752 ef6d bd93 2f47 f377 34db 0c1e 1b6a  7R.m../G.w4....j
00006e0: dc3f 6c21 f0e5 c296 69ee be09 3d2e 8a5d  .?l!....i...=..]
00006f0: 2c27 e172 a52c f183 72e1 4b89 f7b0 cd2b  ,'.r.,..r.K....+
0000700: 78c0 6eaf e795 f0d0 e220 3714 ab72 793e  x.n...... 7..ry>
0000710: 582b 67c4 0aeb 9cfe 08e6 9772 61f1 5e6e  X+g........ra.^n
0000720: d1c7 cf33 226b 6915 af78 5d83 c65c f482  ...3"ki..x]..\..
0000730: 4b46 c26b ad45 2f77 b032 fa01 4916 3f27  KF.k.E/w.2..I.?'
0000740: df3f 1ad4 7afc dd98 5192 6926 7b95 3324  .?..z...Q.i&{.3$
0000750: 1e7b b5c3 a3f4 1586 3ff7 9d32 a129 d3b0  .{......?..2.)..
0000760: 0c65 514e 1683 43f9 9379 0b95 33f5 f1e7  .eQN..C..y..3...
0000770: b314 c0db 9afb 13fa e716 b4ce 397a f963  ............9z.c
0000780: d663 c963 0dda f3a2 9d2f 5e4d 8531 ac20  .c.c...../^M.1. 
0000790: 6f0a 0344 68a6 4779 198d e4ca f189 65aa  o..Dh.Gy......e.
00007a0: 2f6e 8b2f ff74 48c8 4b91 9efa bfc4 5aea  /n./.tH.K.....Z.
00007b0: 7a72 d0c5 fb50 e29a a788 86d1 d787 c9d0  zr...P..........
00007c0: d997 3e81 b830 3bde 83bc e502 cf3f 000a  ..>..0;......?..
00007d0: 7cfe 0360 ea3f 71cf 5f22 c6f0 fcc2 2786  |..`.?q._"....'.
00007e0: ac8b 533a 13b9 1370 637b 3251 104e 88ba  ..S:...pc{2Q.N..
00007f0: f8c6 6a9c 5642 66db 2a8f e29e a610 a86e  ..j.VBf.*......n
0000800: 618f fa4c 69ae 953e 7e48 89cd 9382 26fc  a..Li..>~H....&.
0000810: 5b6f 6aaf 4a15 4f4a 9d62 6768 72e3 08da  [oj.J.OJ.bghr...
0000820: 3dff 6789 a0d2 8927 d73e d17d 019c 6a70  =.g....'.>.}..jp
0000830: d2fd ff07                                ....

オンラインでお試しください!

これは大いにゴルフできることは間違いないより多くの、問題は完全なドキュメントのシナモンガムの欠如です。(@quartata plsこれは驚くべきトロール言語になる可能性が非常に高い)ソースコードを掘り下げて、これに有益なものがあるかどうかを確認します。

これは、圧縮文字列を生成するために一緒にハックしたPythonスクリプトです。


3

PHP、1785 1780 1471バイト

eval(gzinflate(base64_decode('TZXLimRFEIZfZSiKoQsCyfuFpjfqQgTFlS7GQfJqF/Z0DdU1MCK+u1+0DrgpzjmZEfnfImt/eh638+X5Tbs79tNfx/Fw2Cv6IstEl2T07IOMWYp4G5OYELJsl7J0W4u0wI9zw7jAYo09Swze5iYtLheSpLWoryZZsbnS1njvvLia+Gkzy1w+irHGSuyBldFmlemCjWIX7agv0ucosounVa6GjyNXKdHw7tKyklrJUkcrUjL4bKY6lByljR0lbkPjBEQQ1iTFrixtVSu5LLqV1pPksa2MkL00t+C9GhSDnrViFpNDEZs2dRHQwTjwNPTZmdZzdsrKsBCFTR7RevGpKd1c9Ld51jqNspmAjsN4CdOkInkCPVkPxAClyIltDuACzXm4NNpuYyCc2lZJS8kw3kOfw1YqU8UvCFXBE4CCBeLCdCqdiuy3d3RXJrsiNU5otUnBSkstUjjZLT7ywTjFUiRYl/E/ssVkIx5AYmpOdO7grlbBryKRZUnTZnHZVWJSkbQW2oEXhnVvtvaxVAIqyZUnJbrScpGUsc1XBDV787F4KA1rDCvIWDONTetG9ogg1GCUZo3kMKJ0oynL4McRdajBc+xkpG9VKQXes8+cs6ZDFLCIWcYq/dmbChK7lR45b3hwBlMV+aI6Z2fE1mVxBtsg2dRtn5KeKXGhRdyvmkKZ6ESZjWY+oNl4PXOTQbcm8aqKyXjFiDnBNGoduWuLFDnCSOe9kXMuZPdwkvgaNeS10Bv934RsBs6USkAafKxJpgA8VKmFbnbquAITc+OkY8O0bFDKVvKe1va0sCpzhuFmmmSM4iUnQo+WlpSQLFzUTbknLVIXXdr6PoCZG6xWatSHzhym101ZlR86aWtbkBUYkE4I26RBJO1Yagop2ASmbuATH9oNwjZc1cHxDFOcaJZ01oPTOV9hY75vGJ97JEkdJC4w2Na83hiGCUmFu8I1hnbkQWKKStJiUik12ZOLDP2nDmOf1A+U6CpHUuV76pxni6ZyWEgxws5XDT2jUYomJIKlhaGCDRP1iisYy81juCsLEzg3zq7JAG6XQVPwgtsnLnIayErv2IZ16OY0l6GCDFKGzDDBANiGvXkXhHJdlWmeqSCVrZA5SR6lfQn5cH+cD+8OX7c/1vXpcjnI4Zv1fLu2J306X8fT4uHb88vteh43Hr9rHz6s68uH8+3xzds335xvf/Lx+0/9/LR05w/rdr18vDydb+2Z1x8v19vjuurjT+fBhXx+etKCn2l2uZ4bj7+02+vJX7q9vz+uh5dPnRPvPsyofyWCv/50f953LD0cuCMPb98e+zvznrfvDqfrun26Ph/nu/L+fl+uq43Hu/X549NlrjtOkOM4tZfjPtHgv8bHLVxDp4eH4zp9qeD7by8fQf6/Tf6klb+f1ni80P9xfZ5r3PHh/VeHX58P93//Aw==')));

美化

eval('
    // base64_decode(gzinflate()) long string into the further beautified:
    function a($b){
        $c="fe538,e0526,cb734,cd88,3156,0447,f267,b198,a498,22c02456,95b7,54317A,a5e246,6ee34,9061,17938,03323,2963,2ad7,de35,0101,5b423,cad9,d2415,1eb7,ee38,bdc8,f8334,7907,ec79,85034,26e1,6a87,9ca8,8747,1715,4875,acf5,5f023,6245,9596,81e7,ae91,78e07,8ab6,7cf1,c473,a2e6,cea7,b407,ee57,0748,16f7,a5d7,4028,fa26,f723,ddb3,a8c1,9035,7c513,36a38,07838,0a31,9b57,70d34,5c03,4d068,7d87,6130234,85507,adc3,68e0237,1ac1,f0079,6af246,8871,6fc246,4fe7,ad456,8e389,f743,a431,24d238,bad7,3f324,8e57,f901,793246,0641,a6a589,dd23,3541,0202348,4127,cb51,a070,38e0,0976,24b8,7918,7de8,5a07,6d17,2729,3197,89823,af268,9ff18,bce1,9bb8,0523,5468,9a78,67a8,3928,0ff68,83e7,c100,6713,9717,0ab0,fc53,3415,8a10,74c5,b0e246789,0288,16a24,cf60,bf71,66424,73778,ed21,2ff1,0e01246,dba57,f5b1,b500,c318,40923,ae71,7720,19e134,0d37,6a723,3662467,5e76,5f57,f997,4735,dab1,3451,c778,ef75,2ed6,7960,b038,1631,40a6,52b6,ae26,2e9123,ffe8,de27,3678,55d7,45a019,0cb0234,8f98,0893,6a21,10608,c349,98b6,1d734,a726,05d3,fae0,70c5,1991,6ef3,8f168,8771,f790,cc83,76e6,e241,8ec24,31168,7b61,6e268,26f8,7bc23,7a75,e6a1,f4b9,8661,6e724,cc023,ef11,1878,fe78,116238,d060,6081,9f07,9f21,de83,7c48,c295,7c33,d5d5,26334,42c79,e4f0,f3a15,7b58,bbf8,24f5,10423,c0c1,68b7,2aa7,c7c17,8349,a567,36d23,dcb7,b0d38,0bd8,2cf3,bef3,6123,b6b34,18468,c1b9,c51239,38e9,d881,b5579,a4c0,ccc057A,a8d6,a870,e0856,df31,ed43,f277,287345,55e5,b476,bb93,8931,f2424,49d235,70b1,45634,f0e5,7f80,62b3,7ca3,0f18,a8624,6361,3847";
        $d=["Bakerloo","Central","Circle","District","Hammersmith & City","Jubilee","Metropolitan","Northern","Piccadilly","Victoria","Waterloo & City"];
        $e=substr(md5($b), 21, 3);
        if($e=="ddb" && $b[0] == "H") // hard-coded Heathrow Terminals 1, 2, 3 here
            return $d[8];
        foreach(explode(",", $c) as $f)
            if(substr($f, 0, 3) == $e)
                foreach(str_split(substr($f, 3)) as $g)
                    echo $d[hexdec($g)]."\n";
    }
');

説明

ステーション名をできるだけ少ない文字で区別するために、私は少しいじって、MD5ハッシュの22番目、23番目、および24番目の文字を取得すると、1つの衝突を除いて一意になることを発見しました。 ddbのために立つことができHeathrow Terminals 1, 2, 3だけでなく、としてためにDagenham Heathway

11本のチューブライン名を参照するには、0からAまでの16進数を使用します。

次に、MD5ハッシュサブストリングのコンマ区切りリストを作成し、それに対応するチューブラインの数字を付けました。しかし、私は除外しましたHeathrow Terminals 1, 2, 3、衝突を避けるためにリストからしました。

例:fe538どんな駅md5'dの名前が文字有することを意味することをfe522日、23日と24位には、チューブラインはによって呼ば走る38。意味Acton Townは、チューブラインDistrictを実行し、Piccadilly

次に、入力をチェックする簡単な関数を作成しました。MD5はそれをハッシュします。22番目、23番目、24番目の文字を取ります。作成したリストと照合します。そして、対応するチューブ名を表示します。指定された文字列がで始まる場合、にddbハードコードされているコース外の期待で。PiccadillyH

編集

  • 置換array()[]-5文字
  • gzdeflatedとbase64_encodedのコードを使用したeval(gzinflate(base64_decode()))ため、-309文字に使用できるようになりました

MD5ハッシュ数字も16進数です。3つの文字にある12ビットを2つのASCII文字に変換する必要があります。これにより、ステーションごとに1文字削減できます。しかし、これを実行するためのコードが...このアイデアを上回る可能性がある
NL-X

1

Pythonの2 1430の   1418  1416バイト

n=i=0
for e in(input()+' '*26)[:26]:n=n*256+ord(e)
w=bin(n)[2:]
for j in'Bakerloo,Central,Circle,District,Hammersmith & City,Jubilee,Metropolitan,Northern,Piccadilly,Victoria,Waterloo & City'.split(','):
 for z,o in eval('eJxNVclxAzEMa4gPHdRVi8f9txEApOQ8MhNrtSQAgtjP5/Op3fq0cWw3O8dqbV/7TLfVbO8v/v/UZq3ZWrbdTsEJ7k+PR3jZbU471WpZeHvguLZyn9ZtbVpb7w7fr25joUFcOtaOebOx8ZhXHMej23gt0B2/J8/7V4dqvKxvmzVQT6udFxzYju6gbbG1o5+jZbIpxpbVvJNyLQenq9gu+RYu9IIiqCsuLNO7+bbVdQVscAGNTqdUkGZEZSdXMEFl9cUP/0EZ1UYDC3YCTr9oSIJykzWg6XioUqcmGyK2GSzYFtBGitApLMXDxaK7w47H1day0CCSTgGTIeF7wtwsTH5v0n3YXHb4EmrmmHsOEe/RK5tXFnoR8xuSHtNHnUapnSwhM6Wrt9DxS6bfylIKXTkhzA4qr0vPOWMyOxzHTsEHFfMA3GbYBn+NxOfATB/LRZZS+x9FcYlZQK54VSqswCl5hYxjpIO4B3iO2T1Ne0Jp18WEWDVymksOGi3rEG4Tj5r8VM1jHHyEzQOMMHjnFqQCmO0I7y8ZUgY3wJ/xKv7FGKC2ELJnumoSXf1NLxasSsPKLeXGRDeQxjLOcplgJbTv0IOOkqq5znoFvicVRMG8groALmftMwPJ2ncMbecAL3GWS/+iGCUGnFY02hH+hxnW0AEclIsLEtzLTRLiu8o9X6TFvuv1nXeJNdtjcljIMeQMDVeKDo1KiMAB9qVE8oTa03rlrgdlJJlgAmqpDVXpAtdieUDALxKwSaLzmm1bfw7gD9yQrYbIRAjDSWlz7nPleiyZOTTqsfIz1jAn6T91YyEx2LkiElAPVrwpwGiukhQ9q1O+X8R1OiLC7TSltkyuQELiYto7gt4YxP0G+ZiRelnEiS4+CVOJO/6FOgNI2wvNl8SuP2CYEVdUejDhuRRK8nPJTSVVfXmH2oSfHi4ZiG9W+67jYIJxaUaOYd3ATTyRRuOXIjGaFnPxcHdOLhQFChoQctYSEdBfPvFrcnaiR535vqr6JlDnmt8gD5/9kt31WZ47I6w9rE1T3fk1Zcaul01dqSb/NIFLINVif7Q5ir/bauccZuwCv93f7x8/H97i'.decode('base64').decode('zip'))[i]:
	if all([w[k]<'1'for k in z]+[w[k]>'0'for k in o]):print j
 i+=1

オンラインでお試しください!

説明 単語の長さが26未満の場合、右側のスペースで入力単語を完成させると、入力はバイナリ表現(入力単語の各文字の8ビットASCIIコード)としてエンコードされます。すべての可能な入力と出力を区別する最小ビットを見つけます。コードはこれらの特定のビットを見て、出力を決定します。

  • ジョナサンアランのおかげで-12バイト。
  • 辞書編集比較を使用する際のMr. Xcoderのおかげで-2バイト。

これはかなりクールです。印刷できない文字を使用して、代わりにbase64でデコードされた文字列を使用できますか?のs=(s+' '*22)[:26]代わりに1バイトを保存できますs+=' '*(26-len(s))
ジョナサンアラン

1
...さらに、それをインライン化して入力フェッチ:newlineを追加することにより、さらに9つを追加しn=0ますfor e in(input()+' '*26)[:26]:n=n*256+ord(e)n=i=0上部で使用することにより、さらに2つ。
ジョナサンアラン

@JonathanAllanの発言に感謝します。答えを自由に編集してください:)
mdahmoune

保存された12バイトで編集されます。印刷できない文字についてはわかりSyntaxError: Non-ASCII character...ません(やろうとするとわかります)-エンコードヘッダーなどが必要になる場合があります。
ジョナサンアラン

1
辞書編集比較を使用した1416(-2バイト)
ミスターXcoder

1

ジョトリン1.0バイト

提出

{x->d("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=").split("~").w{v ->Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).f{x.hashCode()%2897==b.groupValues[1].toInt()}.m{b.groupValues[2].m{v[0].split("|")[b-'A']}}.first()}}

テストコード

var v:(String)->List<String> =
{x->d("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=").split("~").w{v ->Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).f{x.hashCode()%2897==b.groupValues[1].toInt()}.m{b.groupValues[2].m{v[0].split("|")[b-'A']}}.first()}}
data class Test(val input0: String, val output: List<String>)

val tests = listOf<Test>(
    Test("""Acton Town""",listOf("""District""","""Piccadilly""")),
    Test("""Aldgate""",listOf("""Circle""","""Metropolitan""")),
    Test("""Aldgate East""",listOf("""District""","""Hammersmith & City""")),
    Test("""Alperton""",listOf("""Piccadilly""")),
    Test("""Amersham""",listOf("""Metropolitan""")),
    Test("""Angel""",listOf("""Northern""")),
    Test("""Archway""",listOf("""Northern""")),
    Test("""Arnos Grove""",listOf("""Piccadilly""")),
    Test("""Arsenal""",listOf("""Piccadilly""")),
    Test("""Baker Street""",listOf("""Bakerloo""","""Circle""","""Hammersmith & City""","""Jubilee""","""Metropolitan""")),
    Test("""Balham""",listOf("""Northern""")),
    Test("""Bank""",listOf("""Central""","""Northern""","""Waterloo & City""")),
    Test("""Barbican""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Barking""",listOf("""District""","""Hammersmith & City""")),
    Test("""Barkingside""",listOf("""Central""")),
    Test("""Barons Court""",listOf("""District""","""Piccadilly""")),
    Test("""Bayswater""",listOf("""Circle""","""District""")),
    Test("""Becontree""",listOf("""District""")),
    Test("""Belsize Park""",listOf("""Northern""")),
    Test("""Bermondsey""",listOf("""Jubilee""")),
    Test("""Bethnal Green""",listOf("""Central""")),
    Test("""Blackfriars""",listOf("""Circle""","""District""")),
    Test("""Blackhorse Road""",listOf("""Victoria""")),
    Test("""Bond Street""",listOf("""Central""","""Jubilee""")),
    Test("""Borough""",listOf("""Northern""")),
    Test("""Boston Manor""",listOf("""Piccadilly""")),
    Test("""Bounds Green""",listOf("""Piccadilly""")),
    Test("""Bow Road""",listOf("""District""","""Hammersmith & City""")),
    Test("""Brent Cross""",listOf("""Northern""")),
    Test("""Brixton""",listOf("""Victoria""")),
    Test("""Bromley-by-Bow""",listOf("""District""","""Hammersmith & City""")),
    Test("""Buckhurst Hill""",listOf("""Central""")),
    Test("""Burnt Oak""",listOf("""Northern""")),
    Test("""Caledonian Road""",listOf("""Piccadilly""")),
    Test("""Camden Town""",listOf("""Northern""")),
    Test("""Canada Water""",listOf("""Jubilee""")),
    Test("""Canary Wharf""",listOf("""Jubilee""")),
    Test("""Canning Town""",listOf("""Jubilee""")),
    Test("""Cannon Street""",listOf("""Circle""","""District""")),
    Test("""Canons Park""",listOf("""Jubilee""")),
    Test("""Chalfont & Latimer""",listOf("""Metropolitan""")),
    Test("""Chalk Farm""",listOf("""Northern""")),
    Test("""Chancery Lane""",listOf("""Central""")),
    Test("""Charing Cross""",listOf("""Bakerloo""","""Northern""")),
    Test("""Chesham""",listOf("""Metropolitan""")),
    Test("""Chigwell""",listOf("""Central""")),
    Test("""Chiswick Park""",listOf("""District""")),
    Test("""Chorleywood""",listOf("""Metropolitan""")),
    Test("""Clapham Common""",listOf("""Northern""")),
    Test("""Clapham North""",listOf("""Northern""")),
    Test("""Clapham South""",listOf("""Northern""")),
    Test("""Cockfosters""",listOf("""Piccadilly""")),
    Test("""Colindale""",listOf("""Northern""")),
    Test("""Colliers Wood""",listOf("""Northern""")),
    Test("""Covent Garden""",listOf("""Piccadilly""")),
    Test("""Croxley""",listOf("""Metropolitan""")),
    Test("""Dagenham East""",listOf("""District""")),
    Test("""Dagenham Heathway""",listOf("""District""")),
    Test("""Debden""",listOf("""Central""")),
    Test("""Dollis Hill""",listOf("""Jubilee""")),
    Test("""Ealing Broadway""",listOf("""Central""","""District""")),
    Test("""Ealing Common""",listOf("""District""","""Piccadilly""")),
    Test("""Earl's Court""",listOf("""District""","""Piccadilly""")),
    Test("""East Acton""",listOf("""Central""")),
    Test("""East Finchley""",listOf("""Northern""")),
    Test("""East Ham""",listOf("""District""","""Hammersmith & City""")),
    Test("""East Putney""",listOf("""District""")),
    Test("""Eastcote""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Edgware""",listOf("""Northern""")),
    Test("""Edgware Road""",listOf("""Bakerloo""","""Circle""","""District""","""Hammersmith & City""")),
    Test("""Elephant & Castle""",listOf("""Bakerloo""","""Northern""")),
    Test("""Elm Park""",listOf("""District""")),
    Test("""Embankment""",listOf("""Bakerloo""","""Circle""","""District""","""Northern""")),
    Test("""Epping""",listOf("""Central""")),
    Test("""Euston""",listOf("""Northern""","""Victoria""")),
    Test("""Euston Square""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Fairlop""",listOf("""Central""")),
    Test("""Farringdon""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Finchley Central""",listOf("""Northern""")),
    Test("""Finchley Road""",listOf("""Jubilee""","""Metropolitan""")),
    Test("""Finsbury Park""",listOf("""Piccadilly""","""Victoria""")),
    Test("""Fulham Broadway""",listOf("""District""")),
    Test("""Gants Hill""",listOf("""Central""")),
    Test("""Gloucester Road""",listOf("""Circle""","""District""","""Piccadilly""")),
    Test("""Golders Green""",listOf("""Northern""")),
    Test("""Goldhawk Road""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Goodge Street""",listOf("""Northern""")),
    Test("""Grange Hill""",listOf("""Central""")),
    Test("""Great Portland Street""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Greenford""",listOf("""Central""")),
    Test("""Green Park""",listOf("""Jubilee""","""Piccadilly""","""Victoria""")),
    Test("""Gunnersbury""",listOf("""District""")),
    Test("""Hainault""",listOf("""Central""")),
    Test("""Hammersmith""",listOf("""Circle""","""District""","""Hammersmith & City""","""Piccadilly""")),
    Test("""Hampstead""",listOf("""Northern""")),
    Test("""Hanger Lane""",listOf("""Central""")),
    Test("""Harlesden""",listOf("""Bakerloo""")),
    Test("""Harrow & Wealdstone""",listOf("""Bakerloo""")),
    Test("""Harrow-on-the-Hill""",listOf("""Metropolitan""")),
    Test("""Hatton Cross""",listOf("""Piccadilly""")),
    Test("""Heathrow Terminals 1, 2, 3""",listOf("""Piccadilly""")),
    Test("""Heathrow Terminal 4""",listOf("""Piccadilly""")),
    Test("""Heathrow Terminal 5""",listOf("""Piccadilly""")),
    Test("""Hendon Central""",listOf("""Northern""")),
    Test("""High Barnet""",listOf("""Northern""")),
    Test("""Highbury & Islington""",listOf("""Victoria""")),
    Test("""Highgate""",listOf("""Northern""")),
    Test("""High Street Kensington""",listOf("""Circle""","""District""")),
    Test("""Hillingdon""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Holborn""",listOf("""Central""","""Piccadilly""")),
    Test("""Holland Park""",listOf("""Central""")),
    Test("""Holloway Road""",listOf("""Piccadilly""")),
    Test("""Hornchurch""",listOf("""District""")),
    Test("""Hounslow Central""",listOf("""Piccadilly""")),
    Test("""Hounslow East""",listOf("""Piccadilly""")),
    Test("""Hounslow West""",listOf("""Piccadilly""")),
    Test("""Hyde Park Corner""",listOf("""Piccadilly""")),
    Test("""Ickenham""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Kennington""",listOf("""Northern""")),
    Test("""Kensal Green""",listOf("""Bakerloo""")),
    Test("""Kensington (Olympia)""",listOf("""District""")),
    Test("""Kentish Town""",listOf("""Northern""")),
    Test("""Kenton""",listOf("""Bakerloo""")),
    Test("""Kew Gardens""",listOf("""District""")),
    Test("""Kilburn""",listOf("""Jubilee""")),
    Test("""Kilburn Park""",listOf("""Bakerloo""")),
    Test("""Kingsbury""",listOf("""Jubilee""")),
    Test("""King's Cross St. Pancras""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""","""Northern""","""Piccadilly""","""Victoria""")),
    Test("""Knightsbridge""",listOf("""Piccadilly""")),
    Test("""Ladbroke Grove""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Lambeth North""",listOf("""Bakerloo""")),
    Test("""Lancaster Gate""",listOf("""Central""")),
    Test("""Latimer Road""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Leicester Square""",listOf("""Northern""","""Piccadilly""")),
    Test("""Leyton""",listOf("""Central""")),
    Test("""Leytonstone""",listOf("""Central""")),
    Test("""Liverpool Street""",listOf("""Central""","""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""London Bridge""",listOf("""Jubilee""","""Northern""")),
    Test("""Loughton""",listOf("""Central""")),
    Test("""Maida Vale""",listOf("""Bakerloo""")),
    Test("""Manor House""",listOf("""Piccadilly""")),
    Test("""Mansion House""",listOf("""Circle""","""District""")),
    Test("""Marble Arch""",listOf("""Central""")),
    Test("""Marylebone""",listOf("""Bakerloo""")),
    Test("""Mile End""",listOf("""Central""","""District""","""Hammersmith & City""")),
    Test("""Mill Hill East""",listOf("""Northern""")),
    Test("""Monument""",listOf("""Circle""","""District""")),
    Test("""Moorgate""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""","""Northern""")),
    Test("""Moor Park""",listOf("""Metropolitan""")),
    Test("""Morden""",listOf("""Northern""")),
    Test("""Mornington Crescent""",listOf("""Northern""")),
    Test("""Neasden""",listOf("""Jubilee""")),
    Test("""Newbury Park""",listOf("""Central""")),
    Test("""North Acton""",listOf("""Central""")),
    Test("""North Ealing""",listOf("""Piccadilly""")),
    Test("""North Greenwich""",listOf("""Jubilee""")),
    Test("""North Harrow""",listOf("""Metropolitan""")),
    Test("""North Wembley""",listOf("""Bakerloo""")),
    Test("""Northfields""",listOf("""Piccadilly""")),
    Test("""Northolt""",listOf("""Central""")),
    Test("""Northwick Park""",listOf("""Metropolitan""")),
    Test("""Northwood""",listOf("""Metropolitan""")),
    Test("""Northwood Hills""",listOf("""Metropolitan""")),
    Test("""Notting Hill Gate""",listOf("""Central""","""Circle""","""District""")),
    Test("""Oakwood""",listOf("""Piccadilly""")),
    Test("""Old Street""",listOf("""Northern""")),
    Test("""Osterley""",listOf("""Piccadilly""")),
    Test("""Oval""",listOf("""Northern""")),
    Test("""Oxford Circus""",listOf("""Bakerloo""","""Central""","""Victoria""")),
    Test("""Paddington""",listOf("""Bakerloo""","""Circle""","""District""","""Hammersmith & City""")),
    Test("""Park Royal""",listOf("""Piccadilly""")),
    Test("""Parsons Green""",listOf("""District""")),
    Test("""Perivale""",listOf("""Central""")),
    Test("""Piccadilly Circus""",listOf("""Bakerloo""","""Piccadilly""")),
    Test("""Pimlico""",listOf("""Victoria""")),
    Test("""Pinner""",listOf("""Metropolitan""")),
    Test("""Plaistow""",listOf("""District""","""Hammersmith & City""")),
    Test("""Preston Road""",listOf("""Metropolitan""")),
    Test("""Putney Bridge""",listOf("""District""")),
    Test("""Queen's Park""",listOf("""Bakerloo""")),
    Test("""Queensbury""",listOf("""Jubilee""")),
    Test("""Queensway""",listOf("""Central""")),
    Test("""Ravenscourt Park""",listOf("""District""")),
    Test("""Rayners Lane""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Redbridge""",listOf("""Central""")),
    Test("""Regent's Park""",listOf("""Bakerloo""")),
    Test("""Richmond""",listOf("""District""")),
    Test("""Rickmansworth""",listOf("""Metropolitan""")),
    Test("""Roding Valley""",listOf("""Central""")),
    Test("""Royal Oak""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Ruislip""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Ruislip Gardens""",listOf("""Central""")),
    Test("""Ruislip Manor""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Russell Square""",listOf("""Piccadilly""")),
    Test("""St. James's Park""",listOf("""Circle""","""District""")),
    Test("""St. John's Wood""",listOf("""Jubilee""")),
    Test("""St. Paul's""",listOf("""Central""")),
    Test("""Seven Sisters""",listOf("""Victoria""")),
    Test("""Shepherd's Bush""",listOf("""Central""")),
    Test("""Shepherd's Bush Market""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Sloane Square""",listOf("""Circle""","""District""")),
    Test("""Snaresbrook""",listOf("""Central""")),
    Test("""South Ealing""",listOf("""Piccadilly""")),
    Test("""South Harrow""",listOf("""Piccadilly""")),
    Test("""South Kensington""",listOf("""Circle""","""District""","""Piccadilly""")),
    Test("""South Kenton""",listOf("""Bakerloo""")),
    Test("""South Ruislip""",listOf("""Central""")),
    Test("""South Wimbledon""",listOf("""Northern""")),
    Test("""South Woodford""",listOf("""Central""")),
    Test("""Southfields""",listOf("""District""")),
    Test("""Southgate""",listOf("""Piccadilly""")),
    Test("""Southwark""",listOf("""Jubilee""")),
    Test("""Stamford Brook""",listOf("""District""")),
    Test("""Stanmore""",listOf("""Jubilee""")),
    Test("""Stepney Green""",listOf("""District""","""Hammersmith & City""")),
    Test("""Stockwell""",listOf("""Northern""","""Victoria""")),
    Test("""Stonebridge Park""",listOf("""Bakerloo""")),
    Test("""Stratford""",listOf("""Central""","""Jubilee""")),
    Test("""Sudbury Hill""",listOf("""Piccadilly""")),
    Test("""Sudbury Town""",listOf("""Piccadilly""")),
    Test("""Swiss Cottage""",listOf("""Jubilee""")),
    Test("""Temple""",listOf("""Circle""","""District""")),
    Test("""Theydon Bois""",listOf("""Central""")),
    Test("""Tooting Bec""",listOf("""Northern""")),
    Test("""Tooting Broadway""",listOf("""Northern""")),
    Test("""Tottenham Court Road""",listOf("""Central""","""Northern""")),
    Test("""Tottenham Hale""",listOf("""Victoria""")),
    Test("""Totteridge & Whetstone""",listOf("""Northern""")),
    Test("""Tower Hill""",listOf("""Circle""","""District""")),
    Test("""Tufnell Park""",listOf("""Northern""")),
    Test("""Turnham Green""",listOf("""District""","""Piccadilly""")),
    Test("""Turnpike Lane""",listOf("""Piccadilly""")),
    Test("""Upminster""",listOf("""District""")),
    Test("""Upminster Bridge""",listOf("""District""")),
    Test("""Upney""",listOf("""District""")),
    Test("""Upton Park""",listOf("""District""","""Hammersmith & City""")),
    Test("""Uxbridge""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Vauxhall""",listOf("""Victoria""")),
    Test("""Victoria""",listOf("""Circle""","""District""","""Victoria""")),
    Test("""Walthamstow Central""",listOf("""Victoria""")),
    Test("""Wanstead""",listOf("""Central""")),
    Test("""Warren Street""",listOf("""Northern""","""Victoria""")),
    Test("""Warwick Avenue""",listOf("""Bakerloo""")),
    Test("""Waterloo""",listOf("""Bakerloo""","""Jubilee""","""Northern""","""Waterloo & City""")),
    Test("""Watford""",listOf("""Metropolitan""")),
    Test("""Wembley Central""",listOf("""Bakerloo""")),
    Test("""Wembley Park""",listOf("""Jubilee""","""Metropolitan""")),
    Test("""West Acton""",listOf("""Central""")),
    Test("""West Brompton""",listOf("""District""")),
    Test("""West Finchley""",listOf("""Northern""")),
    Test("""West Ham""",listOf("""District""","""Hammersmith & City""","""Jubilee""")),
    Test("""West Hampstead""",listOf("""Jubilee""")),
    Test("""West Harrow""",listOf("""Metropolitan""")),
    Test("""West Kensington""",listOf("""District""")),
    Test("""West Ruislip""",listOf("""Central""")),
    Test("""Westbourne Park""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Westminster""",listOf("""Circle""","""District""","""Jubilee""")),
    Test("""White City""",listOf("""Central""")),
    Test("""Whitechapel""",listOf("""District""","""Hammersmith & City""")),
    Test("""Willesden Green""",listOf("""Jubilee""")),
    Test("""Willesden Junction""",listOf("""Bakerloo""")),
    Test("""Wimbledon""",listOf("""District""")),
    Test("""Wimbledon Park""",listOf("""District""")),
    Test("""Wood Green""",listOf("""Piccadilly""")),
    Test("""Wood Lane""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Woodford""",listOf("""Central""")),
    Test("""Woodside Park""",listOf("""Northern"""))
)

for (r in tests) {
    val result = v(r.input0)
    if (result != r.output) {
        error("Error during $r, expected ${r.output}, got $result")
    } else {
        print(jotlin.runner.TestUtils.tick)
    }
}

ジョットリンに対する私のコトリンの回答のポート
jrtapsell
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.