From 787b6246ddfd5d1eaa228cdd11c537096362eb2f Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sun, 25 Jun 2017 11:36:34 +0100 Subject: [PATCH] Renamed puzzles, added amidakuji --- 04-08-amidakuji/04-lines.txt | 10135 ++++++++++++++++ 04-08-amidakuji/04-small.txt | 20 + 04-08-amidakuji/amidakuji-creation.ipynb | 2288 ++++ .../amidakuji-solution-1-slow.ipynb | 1881 +++ 04-08-amidakuji/amidakuji-solution-1.ipynb | 416 + 04-08-amidakuji/amidakuji-solution-2.ipynb | 1457 +++ 07-interpreter/machine-code.ipynb | 406 +- .../10-wordsearch.txt | 1678 +-- .../count_1l.txt | 0 .../example-wordsearch.txt | 0 .../exmaple-wordsearch-solution.txt | 0 .../huge-unpadded-wordsearch.txt | 0 .../huge-wordsearch-1500.txt | 0 .../huge-wordsearch-old.txt | 0 .../huge-wordsearch.txt | 1678 +-- .../wordsearch-creation.ipynb | 542 +- .../wordsearch-exploratory-solving.ipynb | 0 .../wordsearch-solution.ipynb | 62 +- .../wordsearch-solution00.txt | 0 .../wordsearch-solution01.txt | 0 .../wordsearch-solution02.txt | 0 .../wordsearch-solution03.txt | 0 .../wordsearch-solution04.txt | 0 .../wordsearch-solution05.txt | 0 .../wordsearch-solution06.txt | 0 .../wordsearch-solution07.txt | 0 .../wordsearch-solution08.txt | 0 .../wordsearch-solution09.txt | 0 .../wordsearch-solution10.txt | 0 .../wordsearch-solution11.txt | 0 .../wordsearch-solution12.txt | 0 .../wordsearch-solution13.txt | 0 .../wordsearch-solution14.txt | 0 .../wordsearch-solution15.txt | 0 .../wordsearch-solution16.txt | 0 .../wordsearch-solution17.txt | 0 .../wordsearch-solution18.txt | 0 .../wordsearch-solution19.txt | 0 .../wordsearch-solution20.txt | 0 .../wordsearch-solution21.txt | 0 .../wordsearch-solution22.txt | 0 .../wordsearch-solution23.txt | 0 .../wordsearch-solution24.txt | 0 .../wordsearch-solution25.txt | 0 .../wordsearch-solution26.txt | 0 .../wordsearch-solution27.txt | 0 .../wordsearch-solution28.txt | 0 .../wordsearch-solution29.txt | 0 .../wordsearch-solution30.txt | 0 .../wordsearch-solution31.txt | 0 .../wordsearch-solution32.txt | 0 .../wordsearch-solution33.txt | 0 .../wordsearch-solution34.txt | 0 .../wordsearch-solution35.txt | 0 .../wordsearch-solution36.txt | 0 .../wordsearch-solution37.txt | 0 .../wordsearch-solution38.txt | 0 .../wordsearch-solution39.txt | 0 .../wordsearch-solution40.txt | 0 .../wordsearch-solution41.txt | 0 .../wordsearch-solution42.txt | 0 .../wordsearch-solution43.txt | 0 .../wordsearch-solution44.txt | 0 .../wordsearch-solution45.txt | 0 .../wordsearch-solution46.txt | 0 .../wordsearch-solution47.txt | 0 .../wordsearch-solution48.txt | 0 .../wordsearch-solution49.txt | 0 .../wordsearch-solution50.txt | 0 .../wordsearch-solution51.txt | 0 .../wordsearch-solution52.txt | 0 .../wordsearch-solution53.txt | 0 .../wordsearch-solution54.txt | 0 .../wordsearch-solution55.txt | 0 .../wordsearch-solution56.txt | 0 .../wordsearch-solution57.txt | 0 .../wordsearch-solution58.txt | 0 .../wordsearch-solution59.txt | 0 .../wordsearch-solution60.txt | 0 .../wordsearch-solution61.txt | 0 .../wordsearch-solution62.txt | 0 .../wordsearch-solution63.txt | 0 .../wordsearch-solution64.txt | 0 .../wordsearch-solution65.txt | 0 .../wordsearch-solution66.txt | 0 .../wordsearch-solution67.txt | 0 .../wordsearch-solution68.txt | 0 .../wordsearch-solution69.txt | 0 .../wordsearch-solution70.txt | 0 .../wordsearch-solution71.txt | 0 .../wordsearch-solution72.txt | 0 .../wordsearch-solution73.txt | 0 .../wordsearch-solution74.txt | 0 .../wordsearch-solution75.txt | 0 .../wordsearch-solution76.txt | 0 .../wordsearch-solution77.txt | 0 .../wordsearch-solution78.txt | 0 .../wordsearch-solution79.txt | 0 .../wordsearch-solution80.txt | 0 .../wordsearch-solution81.txt | 0 .../wordsearch-solution82.txt | 0 .../wordsearch-solution83.txt | 0 .../wordsearch-solution84.txt | 0 .../wordsearch-solution85.txt | 0 .../wordsearch-solution86.txt | 0 .../wordsearch-solution87.txt | 0 .../wordsearch-solution88.txt | 0 .../wordsearch-solution89.txt | 0 .../wordsearch-solution90.txt | 0 .../wordsearch-solution91.txt | 0 .../wordsearch-solution92.txt | 0 .../wordsearch-solution93.txt | 0 .../wordsearch-solution94.txt | 0 .../wordsearch-solution95.txt | 0 .../wordsearch-solution96.txt | 0 .../wordsearch-solution97.txt | 0 .../wordsearch-solution98.txt | 0 .../wordsearch-solution99.txt | 0 .../wordsearch-words | 0 .../wordsearch00.txt | 0 .../wordsearch01.txt | 0 .../wordsearch02.txt | 0 .../wordsearch03.txt | 0 .../wordsearch04.txt | 0 .../wordsearch05.txt | 0 .../wordsearch06.txt | 0 .../wordsearch07.txt | 0 .../wordsearch08.txt | 0 .../wordsearch09.txt | 0 .../wordsearch10.txt | 0 .../wordsearch11.txt | 0 .../wordsearch12.txt | 0 .../wordsearch13.txt | 0 .../wordsearch14.txt | 0 .../wordsearch15.txt | 0 .../wordsearch16.txt | 0 .../wordsearch17.txt | 0 .../wordsearch18.txt | 0 .../wordsearch19.txt | 0 .../wordsearch20.txt | 0 .../wordsearch21.txt | 0 .../wordsearch22.txt | 0 .../wordsearch23.txt | 0 .../wordsearch24.txt | 0 .../wordsearch25.txt | 0 .../wordsearch26.txt | 0 .../wordsearch27.txt | 0 .../wordsearch28.txt | 0 .../wordsearch29.txt | 0 .../wordsearch30.txt | 0 .../wordsearch31.txt | 0 .../wordsearch32.txt | 0 .../wordsearch33.txt | 0 .../wordsearch34.txt | 0 .../wordsearch35.txt | 0 .../wordsearch36.txt | 0 .../wordsearch37.txt | 0 .../wordsearch38.txt | 0 .../wordsearch39.txt | 0 .../wordsearch40.txt | 0 .../wordsearch41.txt | 0 .../wordsearch42.txt | 0 .../wordsearch43.txt | 0 .../wordsearch44.txt | 0 .../wordsearch45.txt | 0 .../wordsearch46.txt | 0 .../wordsearch47.txt | 0 .../wordsearch48.txt | 0 .../wordsearch49.txt | 0 .../wordsearch50.txt | 0 .../wordsearch51.txt | 0 .../wordsearch52.txt | 0 .../wordsearch53.txt | 0 .../wordsearch54.txt | 0 .../wordsearch55.txt | 0 .../wordsearch56.txt | 0 .../wordsearch57.txt | 0 .../wordsearch58.txt | 0 .../wordsearch59.txt | 0 .../wordsearch60.txt | 0 .../wordsearch61.txt | 0 .../wordsearch62.txt | 0 .../wordsearch63.txt | 0 .../wordsearch64.txt | 0 .../wordsearch65.txt | 0 .../wordsearch66.txt | 0 .../wordsearch67.txt | 0 .../wordsearch68.txt | 0 .../wordsearch69.txt | 0 .../wordsearch70.txt | 0 .../wordsearch71.txt | 0 .../wordsearch72.txt | 0 .../wordsearch73.txt | 0 .../wordsearch74.txt | 0 .../wordsearch75.txt | 0 .../wordsearch76.txt | 0 .../wordsearch77.txt | 0 .../wordsearch78.txt | 0 .../wordsearch79.txt | 0 .../wordsearch80.txt | 0 .../wordsearch81.txt | 0 .../wordsearch82.txt | 0 .../wordsearch83.txt | 0 .../wordsearch84.txt | 0 .../wordsearch85.txt | 0 .../wordsearch86.txt | 0 .../wordsearch87.txt | 0 .../wordsearch88.txt | 0 .../wordsearch89.txt | 0 .../wordsearch90.txt | 0 .../wordsearch91.txt | 0 .../wordsearch92.txt | 0 .../wordsearch93.txt | 0 .../wordsearch94.txt | 0 .../wordsearch95.txt | 0 .../wordsearch96.txt | 0 .../wordsearch97.txt | 0 .../wordsearch98.txt | 0 .../wordsearch99.txt | 0 problem-ideas.ipynb | 11 +- 220 files changed, 18656 insertions(+), 1918 deletions(-) create mode 100644 04-08-amidakuji/04-lines.txt create mode 100644 04-08-amidakuji/04-small.txt create mode 100644 04-08-amidakuji/amidakuji-creation.ipynb create mode 100644 04-08-amidakuji/amidakuji-solution-1-slow.ipynb create mode 100644 04-08-amidakuji/amidakuji-solution-1.ipynb create mode 100644 04-08-amidakuji/amidakuji-solution-2.ipynb rename 04-word-search/04-wordsearch.txt => 10-word-search/10-wordsearch.txt (70%) rename {04-word-search => 10-word-search}/count_1l.txt (100%) rename {04-word-search => 10-word-search}/example-wordsearch.txt (100%) rename {04-word-search => 10-word-search}/exmaple-wordsearch-solution.txt (100%) rename {04-word-search => 10-word-search}/huge-unpadded-wordsearch.txt (100%) rename {04-word-search => 10-word-search}/huge-wordsearch-1500.txt (100%) rename {04-word-search => 10-word-search}/huge-wordsearch-old.txt (100%) rename {04-word-search => 10-word-search}/huge-wordsearch.txt (70%) rename {04-word-search => 10-word-search}/wordsearch-creation.ipynb (72%) rename {04-word-search => 10-word-search}/wordsearch-exploratory-solving.ipynb (100%) rename {04-word-search => 10-word-search}/wordsearch-solution.ipynb (94%) rename {04-word-search => 10-word-search}/wordsearch-solution00.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution01.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution02.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution03.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution04.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution05.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution06.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution07.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution08.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution09.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution10.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution11.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution12.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution13.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution14.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution15.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution16.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution17.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution18.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution19.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution20.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution21.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution22.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution23.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution24.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution25.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution26.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution27.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution28.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution29.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution30.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution31.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution32.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution33.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution34.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution35.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution36.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution37.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution38.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution39.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution40.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution41.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution42.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution43.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution44.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution45.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution46.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution47.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution48.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution49.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution50.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution51.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution52.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution53.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution54.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution55.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution56.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution57.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution58.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution59.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution60.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution61.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution62.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution63.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution64.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution65.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution66.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution67.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution68.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution69.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution70.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution71.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution72.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution73.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution74.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution75.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution76.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution77.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution78.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution79.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution80.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution81.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution82.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution83.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution84.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution85.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution86.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution87.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution88.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution89.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution90.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution91.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution92.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution93.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution94.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution95.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution96.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution97.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution98.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-solution99.txt (100%) rename {04-word-search => 10-word-search}/wordsearch-words (100%) rename {04-word-search => 10-word-search}/wordsearch00.txt (100%) rename {04-word-search => 10-word-search}/wordsearch01.txt (100%) rename {04-word-search => 10-word-search}/wordsearch02.txt (100%) rename {04-word-search => 10-word-search}/wordsearch03.txt (100%) rename {04-word-search => 10-word-search}/wordsearch04.txt (100%) rename {04-word-search => 10-word-search}/wordsearch05.txt (100%) rename {04-word-search => 10-word-search}/wordsearch06.txt (100%) rename {04-word-search => 10-word-search}/wordsearch07.txt (100%) rename {04-word-search => 10-word-search}/wordsearch08.txt (100%) rename {04-word-search => 10-word-search}/wordsearch09.txt (100%) rename {04-word-search => 10-word-search}/wordsearch10.txt (100%) rename {04-word-search => 10-word-search}/wordsearch11.txt (100%) rename {04-word-search => 10-word-search}/wordsearch12.txt (100%) rename {04-word-search => 10-word-search}/wordsearch13.txt (100%) rename {04-word-search => 10-word-search}/wordsearch14.txt (100%) rename {04-word-search => 10-word-search}/wordsearch15.txt (100%) rename {04-word-search => 10-word-search}/wordsearch16.txt (100%) rename {04-word-search => 10-word-search}/wordsearch17.txt (100%) rename {04-word-search => 10-word-search}/wordsearch18.txt (100%) rename {04-word-search => 10-word-search}/wordsearch19.txt (100%) rename {04-word-search => 10-word-search}/wordsearch20.txt (100%) rename {04-word-search => 10-word-search}/wordsearch21.txt (100%) rename {04-word-search => 10-word-search}/wordsearch22.txt (100%) rename {04-word-search => 10-word-search}/wordsearch23.txt (100%) rename {04-word-search => 10-word-search}/wordsearch24.txt (100%) rename {04-word-search => 10-word-search}/wordsearch25.txt (100%) rename {04-word-search => 10-word-search}/wordsearch26.txt (100%) rename {04-word-search => 10-word-search}/wordsearch27.txt (100%) rename {04-word-search => 10-word-search}/wordsearch28.txt (100%) rename {04-word-search => 10-word-search}/wordsearch29.txt (100%) rename {04-word-search => 10-word-search}/wordsearch30.txt (100%) rename {04-word-search => 10-word-search}/wordsearch31.txt (100%) rename {04-word-search => 10-word-search}/wordsearch32.txt (100%) rename {04-word-search => 10-word-search}/wordsearch33.txt (100%) rename {04-word-search => 10-word-search}/wordsearch34.txt (100%) rename {04-word-search => 10-word-search}/wordsearch35.txt (100%) rename {04-word-search => 10-word-search}/wordsearch36.txt (100%) rename {04-word-search => 10-word-search}/wordsearch37.txt (100%) rename {04-word-search => 10-word-search}/wordsearch38.txt (100%) rename {04-word-search => 10-word-search}/wordsearch39.txt (100%) rename {04-word-search => 10-word-search}/wordsearch40.txt (100%) rename {04-word-search => 10-word-search}/wordsearch41.txt (100%) rename {04-word-search => 10-word-search}/wordsearch42.txt (100%) rename {04-word-search => 10-word-search}/wordsearch43.txt (100%) rename {04-word-search => 10-word-search}/wordsearch44.txt (100%) rename {04-word-search => 10-word-search}/wordsearch45.txt (100%) rename {04-word-search => 10-word-search}/wordsearch46.txt (100%) rename {04-word-search => 10-word-search}/wordsearch47.txt (100%) rename {04-word-search => 10-word-search}/wordsearch48.txt (100%) rename {04-word-search => 10-word-search}/wordsearch49.txt (100%) rename {04-word-search => 10-word-search}/wordsearch50.txt (100%) rename {04-word-search => 10-word-search}/wordsearch51.txt (100%) rename {04-word-search => 10-word-search}/wordsearch52.txt (100%) rename {04-word-search => 10-word-search}/wordsearch53.txt (100%) rename {04-word-search => 10-word-search}/wordsearch54.txt (100%) rename {04-word-search => 10-word-search}/wordsearch55.txt (100%) rename {04-word-search => 10-word-search}/wordsearch56.txt (100%) rename {04-word-search => 10-word-search}/wordsearch57.txt (100%) rename {04-word-search => 10-word-search}/wordsearch58.txt (100%) rename {04-word-search => 10-word-search}/wordsearch59.txt (100%) rename {04-word-search => 10-word-search}/wordsearch60.txt (100%) rename {04-word-search => 10-word-search}/wordsearch61.txt (100%) rename {04-word-search => 10-word-search}/wordsearch62.txt (100%) rename {04-word-search => 10-word-search}/wordsearch63.txt (100%) rename {04-word-search => 10-word-search}/wordsearch64.txt (100%) rename {04-word-search => 10-word-search}/wordsearch65.txt (100%) rename {04-word-search => 10-word-search}/wordsearch66.txt (100%) rename {04-word-search => 10-word-search}/wordsearch67.txt (100%) rename {04-word-search => 10-word-search}/wordsearch68.txt (100%) rename {04-word-search => 10-word-search}/wordsearch69.txt (100%) rename {04-word-search => 10-word-search}/wordsearch70.txt (100%) rename {04-word-search => 10-word-search}/wordsearch71.txt (100%) rename {04-word-search => 10-word-search}/wordsearch72.txt (100%) rename {04-word-search => 10-word-search}/wordsearch73.txt (100%) rename {04-word-search => 10-word-search}/wordsearch74.txt (100%) rename {04-word-search => 10-word-search}/wordsearch75.txt (100%) rename {04-word-search => 10-word-search}/wordsearch76.txt (100%) rename {04-word-search => 10-word-search}/wordsearch77.txt (100%) rename {04-word-search => 10-word-search}/wordsearch78.txt (100%) rename {04-word-search => 10-word-search}/wordsearch79.txt (100%) rename {04-word-search => 10-word-search}/wordsearch80.txt (100%) rename {04-word-search => 10-word-search}/wordsearch81.txt (100%) rename {04-word-search => 10-word-search}/wordsearch82.txt (100%) rename {04-word-search => 10-word-search}/wordsearch83.txt (100%) rename {04-word-search => 10-word-search}/wordsearch84.txt (100%) rename {04-word-search => 10-word-search}/wordsearch85.txt (100%) rename {04-word-search => 10-word-search}/wordsearch86.txt (100%) rename {04-word-search => 10-word-search}/wordsearch87.txt (100%) rename {04-word-search => 10-word-search}/wordsearch88.txt (100%) rename {04-word-search => 10-word-search}/wordsearch89.txt (100%) rename {04-word-search => 10-word-search}/wordsearch90.txt (100%) rename {04-word-search => 10-word-search}/wordsearch91.txt (100%) rename {04-word-search => 10-word-search}/wordsearch92.txt (100%) rename {04-word-search => 10-word-search}/wordsearch93.txt (100%) rename {04-word-search => 10-word-search}/wordsearch94.txt (100%) rename {04-word-search => 10-word-search}/wordsearch95.txt (100%) rename {04-word-search => 10-word-search}/wordsearch96.txt (100%) rename {04-word-search => 10-word-search}/wordsearch97.txt (100%) rename {04-word-search => 10-word-search}/wordsearch98.txt (100%) rename {04-word-search => 10-word-search}/wordsearch99.txt (100%) diff --git a/04-08-amidakuji/04-lines.txt b/04-08-amidakuji/04-lines.txt new file mode 100644 index 0000000..c859642 --- /dev/null +++ b/04-08-amidakuji/04-lines.txt @@ -0,0 +1,10135 @@ +(15, 25) +(5, 21) +(1, 19) +(7, 8) +(6, 14) +(2, 9) +(11, 16) +(1, 10) +(14, 22) +(2, 25) +(7, 9) +(8, 18) +(6, 23) +(4, 6) +(2, 13) +(9, 14) +(12, 18) +(0, 10) +(2, 3) +(6, 19) +(1, 10) +(8, 10) +(0, 19) +(10, 25) +(19, 20) +(2, 25) +(10, 23) +(3, 19) +(17, 20) +(3, 5) +(8, 25) +(19, 23) +(2, 21) +(16, 17) +(1, 10) +(2, 18) +(8, 13) +(3, 4) +(1, 5) +(1, 21) +(11, 13) +(4, 12) +(0, 8) +(3, 4) +(1, 5) +(4, 10) +(1, 21) +(5, 22) +(1, 12) +(10, 15) +(4, 9) +(5, 24) +(8, 21) +(3, 8) +(1, 14) +(14, 24) +(8, 13) +(1, 12) +(3, 22) +(13, 19) +(0, 3) +(1, 10) +(12, 18) +(5, 22) +(4, 19) +(5, 7) +(10, 16) +(0, 17) +(9, 13) +(3, 18) +(6, 13) +(0, 14) +(19, 25) +(2, 17) +(4, 21) +(3, 16) +(10, 15) +(11, 19) +(2, 22) +(3, 4) +(9, 15) +(11, 21) +(2, 18) +(8, 19) +(8, 23) +(2, 25) +(10, 18) +(2, 22) +(7, 25) +(6, 18) +(22, 25) +(7, 11) +(2, 12) +(0, 18) +(9, 11) +(12, 19) +(2, 10) +(22, 24) +(10, 15) +(24, 25) +(20, 22) +(19, 23) +(8, 10) +(0, 19) +(16, 22) +(15, 21) +(1, 21) +(13, 22) +(12, 16) +(15, 17) +(2, 10) +(0, 18) +(6, 10) +(21, 23) +(9, 15) +(2, 7) +(9, 23) +(0, 6) +(10, 24) +(7, 21) +(5, 23) +(14, 24) +(1, 10) +(6, 7) +(5, 21) +(4, 6) +(9, 10) +(1, 20) +(2, 23) +(1, 25) +(0, 20) +(9, 16) +(13, 20) +(2, 25) +(1, 17) +(16, 24) +(9, 10) +(19, 25) +(3, 16) +(20, 21) +(13, 18) +(14, 24) +(1, 23) +(0, 17) +(0, 10) +(17, 19) +(9, 23) +(1, 15) +(12, 25) +(13, 24) +(0, 3) +(2, 19) +(23, 24) +(4, 10) +(3, 8) +(4, 7) +(2, 9) +(20, 23) +(5, 7) +(2, 18) +(9, 11) +(0, 3) +(2, 12) +(7, 24) +(0, 16) +(3, 9) +(10, 18) +(6, 7) +(9, 20) +(3, 21) +(15, 16) +(16, 23) +(5, 7) +(3, 8) +(0, 9) +(8, 12) +(7, 15) +(5, 9) +(0, 6) +(16, 19) +(9, 18) +(12, 21) +(1, 6) +(16, 23) +(0, 3) +(16, 19) +(3, 14) +(0, 18) +(6, 20) +(21, 24) +(1, 17) +(2, 12) +(12, 13) +(2, 8) +(17, 24) +(5, 20) +(1, 16) +(3, 19) +(8, 22) +(19, 20) +(2, 10) +(12, 25) +(4, 8) +(2, 7) +(13, 25) +(9, 20) +(20, 21) +(5, 8) +(4, 10) +(0, 9) +(5, 14) +(6, 9) +(2, 20) +(0, 16) +(5, 10) +(14, 20) +(0, 11) +(1, 16) +(3, 9) +(3, 6) +(2, 16) +(0, 12) +(11, 22) +(2, 25) +(11, 23) +(0, 17) +(12, 18) +(3, 14) +(1, 22) +(8, 25) +(5, 12) +(0, 24) +(15, 23) +(3, 21) +(2, 22) +(0, 12) +(7, 23) +(1, 25) +(5, 18) +(11, 24) +(3, 6) +(12, 18) +(7, 19) +(5, 20) +(10, 23) +(3, 4) +(3, 21) +(4, 19) +(7, 15) +(0, 10) +(20, 22) +(14, 23) +(21, 24) +(3, 20) +(8, 14) +(6, 23) +(10, 18) +(4, 20) +(6, 9) +(8, 13) +(16, 23) +(11, 14) +(13, 17) +(8, 10) +(16, 19) +(11, 15) +(9, 10) +(13, 14) +(17, 25) +(9, 16) +(6, 17) +(0, 14) +(10, 23) +(11, 25) +(0, 4) +(3, 23) +(20, 25) +(14, 24) +(6, 8) +(10, 22) +(17, 23) +(5, 6) +(14, 16) +(0, 10) +(8, 12) +(10, 13) +(2, 12) +(4, 6) +(1, 17) +(14, 21) +(6, 15) +(2, 3) +(0, 10) +(2, 22) +(0, 8) +(3, 18) +(10, 13) +(2, 15) +(3, 19) +(8, 17) +(0, 18) +(10, 23) +(12, 13) +(17, 20) +(5, 13) +(3, 25) +(0, 9) +(6, 12) +(15, 16) +(14, 23) +(5, 14) +(15, 21) +(1, 23) +(6, 24) +(13, 18) +(10, 23) +(13, 22) +(4, 24) +(3, 14) +(1, 6) +(5, 6) +(13, 25) +(6, 15) +(5, 21) +(13, 19) +(9, 25) +(13, 16) +(9, 22) +(18, 25) +(6, 22) +(10, 25) +(9, 24) +(3, 13) +(6, 11) +(16, 22) +(10, 18) +(3, 17) +(15, 24) +(8, 25) +(9, 23) +(2, 23) +(10, 12) +(13, 17) +(8, 15) +(0, 25) +(19, 24) +(16, 24) +(12, 15) +(13, 25) +(7, 10) +(3, 17) +(0, 2) +(7, 11) +(16, 19) +(5, 10) +(12, 17) +(2, 24) +(14, 25) +(4, 10) +(2, 22) +(5, 8) +(1, 14) +(5, 18) +(12, 14) +(8, 20) +(4, 15) +(10, 21) +(18, 19) +(10, 23) +(8, 16) +(20, 22) +(5, 7) +(7, 9) +(0, 22) +(8, 11) +(19, 20) +(4, 16) +(11, 20) +(4, 17) +(9, 21) +(8, 15) +(6, 22) +(3, 16) +(1, 19) +(0, 19) +(5, 6) +(7, 16) +(1, 24) +(8, 10) +(8, 14) +(3, 10) +(7, 11) +(2, 5) +(12, 19) +(6, 18) +(13, 24) +(10, 13) +(1, 3) +(12, 16) +(6, 9) +(19, 23) +(14, 17) +(4, 24) +(3, 20) +(15, 16) +(1, 7) +(11, 12) +(0, 24) +(10, 18) +(2, 13) +(12, 22) +(0, 17) +(4, 10) +(15, 25) +(10, 23) +(13, 15) +(1, 25) +(4, 17) +(13, 18) +(2, 10) +(21, 25) +(4, 14) +(1, 11) +(0, 4) +(14, 19) +(8, 11) +(9, 18) +(1, 15) +(13, 18) +(5, 11) +(2, 8) +(3, 13) +(5, 16) +(15, 18) +(3, 23) +(7, 18) +(13, 17) +(0, 15) +(5, 9) +(5, 15) +(1, 23) +(18, 20) +(17, 24) +(6, 13) +(12, 15) +(5, 14) +(20, 23) +(1, 21) +(16, 17) +(20, 24) +(16, 23) +(10, 17) +(7, 14) +(11, 16) +(7, 23) +(24, 25) +(10, 21) +(22, 23) +(10, 18) +(4, 16) +(17, 21) +(15, 22) +(18, 19) +(13, 21) +(16, 20) +(15, 23) +(21, 24) +(14, 16) +(3, 13) +(5, 20) +(17, 19) +(7, 22) +(9, 21) +(7, 23) +(2, 13) +(14, 25) +(5, 24) +(3, 8) +(6, 16) +(0, 6) +(3, 7) +(13, 22) +(14, 18) +(3, 12) +(4, 6) +(0, 8) +(6, 9) +(7, 8) +(1, 3) +(4, 25) +(0, 20) +(17, 20) +(8, 18) +(5, 6) +(10, 25) +(8, 15) +(6, 23) +(10, 21) +(4, 5) +(14, 18) +(14, 20) +(11, 21) +(6, 24) +(4, 18) +(3, 4) +(7, 24) +(6, 17) +(17, 19) +(4, 25) +(18, 24) +(7, 10) +(6, 12) +(10, 18) +(5, 19) +(6, 23) +(12, 16) +(0, 17) +(4, 14) +(3, 19) +(9, 12) +(11, 23) +(6, 21) +(1, 17) +(16, 22) +(1, 24) +(5, 12) +(0, 9) +(19, 21) +(6, 8) +(17, 24) +(5, 9) +(2, 12) +(1, 15) +(17, 22) +(20, 24) +(2, 23) +(14, 15) +(1, 13) +(3, 20) +(4, 24) +(2, 23) +(0, 1) +(13, 25) +(10, 17) +(7, 10) +(20, 24) +(13, 22) +(1, 9) +(0, 3) +(0, 20) +(18, 24) +(22, 23) +(5, 7) +(10, 11) +(2, 11) +(8, 24) +(14, 20) +(7, 12) +(0, 25) +(4, 18) +(2, 3) +(23, 25) +(0, 15) +(14, 21) +(16, 18) +(13, 24) +(6, 12) +(0, 21) +(7, 23) +(2, 14) +(10, 24) +(6, 17) +(3, 22) +(9, 12) +(15, 22) +(11, 24) +(6, 21) +(3, 14) +(0, 9) +(10, 16) +(5, 17) +(6, 13) +(22, 25) +(2, 10) +(8, 15) +(4, 25) +(13, 19) +(8, 24) +(10, 13) +(4, 6) +(3, 25) +(0, 24) +(18, 19) +(8, 9) +(8, 19) +(18, 20) +(7, 13) +(5, 10) +(17, 25) +(6, 25) +(20, 24) +(16, 18) +(12, 16) +(2, 20) +(15, 18) +(5, 24) +(4, 25) +(9, 20) +(3, 18) +(8, 16) +(2, 22) +(2, 15) +(7, 16) +(11, 20) +(1, 7) +(0, 11) +(2, 6) +(11, 15) +(2, 22) +(0, 14) +(1, 16) +(1, 10) +(16, 20) +(14, 17) +(6, 15) +(4, 11) +(0, 15) +(5, 20) +(12, 17) +(1, 11) +(10, 20) +(5, 9) +(12, 18) +(17, 24) +(15, 20) +(4, 12) +(14, 18) +(5, 16) +(14, 19) +(5, 13) +(8, 16) +(1, 12) +(18, 23) +(10, 13) +(5, 11) +(9, 19) +(8, 21) +(14, 25) +(12, 17) +(0, 16) +(23, 24) +(15, 18) +(6, 18) +(16, 25) +(15, 19) +(10, 21) +(0, 13) +(5, 17) +(18, 22) +(11, 15) +(0, 24) +(7, 19) +(5, 8) +(2, 10) +(10, 21) +(23, 24) +(0, 24) +(11, 23) +(2, 10) +(0, 16) +(6, 11) +(2, 25) +(10, 21) +(12, 24) +(10, 22) +(1, 16) +(12, 13) +(4, 25) +(0, 9) +(12, 22) +(19, 25) +(10, 20) +(7, 13) +(1, 2) +(16, 19) +(2, 3) +(0, 25) +(4, 22) +(6, 13) +(13, 15) +(0, 5) +(6, 9) +(22, 24) +(1, 2) +(8, 16) +(12, 25) +(7, 16) +(8, 21) +(13, 24) +(3, 5) +(9, 23) +(3, 18) +(0, 8) +(9, 11) +(2, 5) +(10, 13) +(6, 21) +(15, 23) +(9, 13) +(15, 23) +(1, 11) +(8, 20) +(3, 10) +(4, 6) +(14, 18) +(8, 15) +(1, 2) +(0, 6) +(10, 19) +(20, 21) +(20, 24) +(21, 23) +(10, 16) +(6, 22) +(23, 25) +(5, 21) +(8, 20) +(14, 24) +(8, 21) +(6, 14) +(10, 23) +(4, 5) +(4, 20) +(6, 25) +(5, 19) +(10, 12) +(8, 9) +(1, 20) +(9, 18) +(11, 19) +(0, 6) +(8, 13) +(7, 13) +(17, 18) +(20, 21) +(3, 9) +(6, 11) +(2, 18) +(4, 20) +(7, 8) +(13, 22) +(12, 21) +(3, 6) +(6, 11) +(2, 24) +(12, 14) +(20, 23) +(5, 7) +(2, 17) +(5, 12) +(3, 6) +(0, 7) +(8, 24) +(18, 23) +(15, 23) +(7, 20) +(1, 2) +(8, 13) +(22, 24) +(17, 24) +(1, 25) +(16, 23) +(8, 19) +(17, 18) +(20, 25) +(14, 16) +(0, 1) +(9, 23) +(3, 19) +(22, 23) +(19, 20) +(24, 25) +(9, 12) +(6, 23) +(2, 22) +(17, 25) +(8, 23) +(1, 6) +(19, 25) +(2, 16) +(14, 22) +(0, 14) +(6, 16) +(4, 23) +(1, 13) +(21, 22) +(17, 25) +(8, 18) +(6, 15) +(1, 3) +(7, 22) +(14, 24) +(1, 23) +(7, 9) +(10, 22) +(19, 24) +(1, 2) +(3, 22) +(5, 10) +(3, 8) +(5, 12) +(11, 12) +(12, 15) +(10, 11) +(10, 15) +(0, 11) +(10, 14) +(5, 15) +(11, 21) +(0, 9) +(8, 14) +(6, 21) +(5, 18) +(11, 12) +(0, 5) +(4, 12) +(18, 22) +(11, 13) +(3, 8) +(3, 16) +(10, 13) +(12, 15) +(5, 20) +(12, 16) +(8, 15) +(20, 22) +(4, 5) +(1, 5) +(14, 20) +(6, 12) +(3, 8) +(4, 7) +(10, 22) +(5, 22) +(2, 6) +(9, 20) +(0, 12) +(8, 23) +(10, 21) +(1, 10) +(7, 20) +(7, 24) +(1, 14) +(14, 18) +(2, 24) +(1, 20) +(7, 22) +(9, 20) +(1, 8) +(2, 21) +(18, 19) +(7, 23) +(16, 22) +(1, 12) +(13, 23) +(9, 25) +(5, 21) +(12, 20) +(2, 21) +(13, 18) +(20, 23) +(5, 21) +(16, 21) +(5, 19) +(10, 23) +(16, 24) +(4, 21) +(5, 14) +(14, 18) +(22, 24) +(0, 16) +(7, 21) +(14, 16) +(8, 21) +(1, 24) +(0, 15) +(16, 23) +(2, 14) +(21, 22) +(15, 18) +(12, 18) +(3, 22) +(8, 14) +(5, 15) +(2, 4) +(3, 10) +(1, 14) +(4, 9) +(13, 22) +(6, 8) +(18, 21) +(11, 12) +(16, 18) +(12, 17) +(4, 21) +(0, 14) +(9, 23) +(10, 15) +(0, 11) +(14, 18) +(7, 16) +(12, 22) +(5, 23) +(3, 9) +(14, 24) +(10, 11) +(5, 7) +(6, 22) +(0, 19) +(16, 25) +(1, 9) +(5, 9) +(14, 23) +(6, 11) +(0, 15) +(1, 3) +(20, 24) +(1, 7) +(14, 18) +(20, 22) +(11, 12) +(0, 7) +(18, 25) +(9, 12) +(6, 22) +(2, 11) +(13, 18) +(16, 25) +(0, 7) +(1, 9) +(10, 11) +(18, 20) +(13, 25) +(11, 12) +(7, 17) +(0, 2) +(10, 19) +(7, 15) +(8, 13) +(0, 24) +(5, 19) +(22, 25) +(4, 22) +(18, 24) +(8, 9) +(2, 13) +(14, 15) +(7, 14) +(13, 23) +(16, 18) +(14, 15) +(2, 16) +(6, 7) +(22, 23) +(22, 23) +(1, 14) +(6, 8) +(15, 25) +(6, 24) +(17, 25) +(8, 11) +(15, 21) +(4, 15) +(10, 24) +(17, 23) +(7, 11) +(13, 15) +(6, 11) +(17, 23) +(7, 21) +(3, 21) +(4, 7) +(12, 15) +(4, 14) +(6, 21) +(9, 15) +(12, 13) +(3, 5) +(19, 21) +(4, 25) +(3, 24) +(6, 7) +(5, 18) +(9, 22) +(14, 23) +(5, 7) +(14, 15) +(16, 22) +(20, 24) +(2, 18) +(0, 3) +(0, 6) +(21, 22) +(18, 23) +(3, 12) +(9, 16) +(5, 17) +(14, 19) +(11, 23) +(14, 24) +(19, 20) +(12, 22) +(7, 20) +(5, 19) +(17, 24) +(0, 20) +(5, 6) +(4, 19) +(7, 25) +(10, 17) +(1, 10) +(4, 8) +(3, 25) +(7, 18) +(8, 14) +(5, 7) +(22, 25) +(3, 6) +(4, 10) +(3, 20) +(0, 7) +(4, 15) +(16, 25) +(2, 6) +(3, 8) +(0, 9) +(7, 24) +(16, 18) +(17, 20) +(17, 19) +(1, 20) +(22, 24) +(0, 12) +(12, 13) +(2, 17) +(3, 24) +(20, 22) +(0, 11) +(4, 24) +(10, 11) +(14, 20) +(1, 3) +(6, 17) +(3, 25) +(6, 16) +(1, 5) +(0, 20) +(2, 17) +(4, 8) +(19, 25) +(3, 9) +(2, 21) +(8, 18) +(0, 12) +(4, 21) +(2, 16) +(15, 19) +(3, 25) +(10, 15) +(8, 19) +(9, 25) +(11, 19) +(7, 8) +(10, 14) +(3, 8) +(2, 10) +(13, 14) +(5, 11) +(6, 7) +(6, 20) +(3, 9) +(11, 16) +(7, 14) +(5, 24) +(17, 24) +(0, 11) +(20, 22) +(10, 16) +(6, 18) +(11, 12) +(8, 18) +(14, 16) +(17, 22) +(1, 20) +(5, 6) +(8, 9) +(17, 18) +(10, 14) +(16, 21) +(6, 7) +(5, 7) +(4, 6) +(11, 16) +(2, 4) +(10, 11) +(6, 15) +(7, 22) +(15, 25) +(7, 24) +(13, 22) +(2, 5) +(5, 18) +(2, 19) +(1, 7) +(4, 25) +(2, 12) +(4, 21) +(7, 16) +(9, 18) +(1, 24) +(13, 24) +(7, 21) +(14, 16) +(21, 23) +(8, 14) +(6, 23) +(14, 17) +(8, 22) +(23, 25) +(6, 13) +(12, 14) +(11, 17) +(20, 25) +(16, 23) +(13, 21) +(11, 14) +(9, 11) +(16, 20) +(15, 25) +(0, 23) +(11, 18) +(0, 2) +(16, 20) +(9, 14) +(9, 18) +(2, 3) +(0, 19) +(8, 20) +(3, 4) +(0, 5) +(4, 24) +(3, 10) +(4, 23) +(3, 19) +(10, 21) +(1, 21) +(3, 6) +(2, 10) +(6, 21) +(2, 17) +(3, 22) +(1, 23) +(1, 2) +(3, 13) +(0, 22) +(14, 21) +(7, 17) +(21, 22) +(13, 16) +(14, 19) +(2, 4) +(1, 17) +(6, 19) +(21, 24) +(15, 16) +(1, 3) +(4, 25) +(8, 22) +(5, 22) +(19, 20) +(14, 21) +(13, 22) +(0, 14) +(11, 19) +(5, 15) +(13, 23) +(6, 15) +(19, 24) +(17, 22) +(10, 23) +(7, 15) +(13, 21) +(8, 15) +(10, 14) +(7, 25) +(4, 23) +(9, 21) +(13, 16) +(2, 21) +(5, 9) +(4, 18) +(15, 19) +(0, 8) +(15, 25) +(13, 21) +(5, 11) +(0, 19) +(4, 22) +(8, 11) +(7, 15) +(14, 22) +(5, 9) +(13, 24) +(6, 21) +(3, 14) +(4, 21) +(1, 5) +(20, 22) +(9, 24) +(5, 18) +(9, 17) +(0, 14) +(4, 13) +(1, 6) +(1, 23) +(3, 6) +(13, 22) +(5, 8) +(5, 7) +(13, 18) +(1, 9) +(3, 19) +(11, 23) +(13, 25) +(1, 2) +(0, 23) +(11, 14) +(0, 18) +(13, 24) +(8, 14) +(13, 17) +(0, 3) +(4, 18) +(6, 24) +(6, 25) +(12, 17) +(18, 21) +(4, 16) +(13, 19) +(15, 16) +(17, 20) +(0, 13) +(9, 18) +(4, 24) +(21, 25) +(5, 12) +(15, 24) +(18, 25) +(3, 16) +(1, 20) +(7, 13) +(4, 19) +(7, 11) +(4, 6) +(1, 10) +(10, 21) +(7, 13) +(1, 17) +(2, 4) +(10, 22) +(2, 5) +(7, 11) +(12, 21) +(7, 16) +(17, 21) +(10, 13) +(1, 22) +(1, 9) +(13, 16) +(3, 21) +(17, 23) +(1, 22) +(15, 21) +(10, 23) +(12, 17) +(5, 10) +(2, 15) +(11, 22) +(17, 19) +(0, 12) +(1, 25) +(9, 12) +(19, 24) +(2, 20) +(17, 19) +(2, 4) +(8, 24) +(3, 24) +(9, 17) +(19, 21) +(3, 20) +(16, 24) +(9, 18) +(9, 14) +(3, 13) +(1, 20) +(1, 6) +(14, 15) +(16, 20) +(8, 9) +(9, 19) +(16, 22) +(15, 24) +(12, 14) +(7, 20) +(8, 15) +(14, 19) +(3, 24) +(12, 21) +(16, 18) +(9, 10) +(6, 9) +(2, 16) +(12, 18) +(20, 24) +(11, 19) +(0, 8) +(5, 14) +(4, 15) +(14, 25) +(7, 8) +(5, 13) +(0, 19) +(0, 2) +(23, 25) +(14, 15) +(13, 18) +(19, 24) +(20, 24) +(5, 15) +(0, 9) +(12, 25) +(8, 13) +(3, 23) +(2, 17) +(1, 8) +(2, 11) +(14, 15) +(5, 15) +(2, 7) +(14, 16) +(5, 12) +(14, 25) +(15, 17) +(0, 5) +(15, 21) +(12, 20) +(17, 24) +(6, 21) +(12, 25) +(9, 15) +(15, 18) +(21, 22) +(6, 17) +(0, 9) +(20, 22) +(4, 21) +(6, 15) +(9, 24) +(0, 8) +(5, 17) +(7, 21) +(1, 4) +(17, 20) +(11, 15) +(1, 7) +(14, 20) +(12, 21) +(0, 11) +(2, 4) +(7, 13) +(2, 10) +(5, 12) +(1, 3) +(14, 15) +(12, 13) +(10, 19) +(2, 23) +(0, 5) +(1, 16) +(7, 20) +(15, 23) +(12, 18) +(10, 14) +(16, 24) +(6, 13) +(0, 8) +(17, 24) +(1, 8) +(3, 16) +(9, 23) +(12, 21) +(7, 13) +(15, 19) +(1, 19) +(12, 25) +(13, 15) +(18, 21) +(5, 8) +(4, 12) +(0, 18) +(1, 14) +(15, 17) +(5, 23) +(7, 17) +(8, 23) +(0, 6) +(13, 18) +(4, 22) +(14, 25) +(6, 22) +(13, 20) +(1, 23) +(11, 25) +(0, 24) +(5, 14) +(11, 13) +(2, 5) +(18, 23) +(6, 7) +(16, 24) +(16, 19) +(0, 13) +(2, 3) +(9, 24) +(4, 13) +(15, 16) +(17, 24) +(0, 21) +(19, 22) +(0, 6) +(4, 12) +(9, 19) +(13, 25) +(1, 4) +(15, 25) +(9, 23) +(12, 21) +(17, 23) +(3, 15) +(9, 20) +(2, 17) +(9, 13) +(15, 22) +(0, 20) +(14, 15) +(3, 17) +(15, 25) +(3, 5) +(14, 18) +(2, 17) +(10, 18) +(2, 4) +(0, 14) +(3, 24) +(15, 19) +(7, 19) +(22, 24) +(15, 25) +(5, 24) +(7, 16) +(12, 25) +(4, 25) +(16, 20) +(7, 18) +(1, 5) +(4, 21) +(7, 14) +(20, 23) +(8, 18) +(9, 16) +(3, 9) +(10, 18) +(8, 22) +(13, 23) +(7, 11) +(9, 20) +(7, 25) +(10, 11) +(3, 6) +(15, 23) +(2, 13) +(0, 11) +(21, 23) +(3, 13) +(8, 9) +(12, 20) +(15, 22) +(9, 22) +(15, 23) +(16, 21) +(7, 12) +(0, 8) +(1, 20) +(5, 21) +(7, 20) +(10, 15) +(23, 25) +(8, 11) +(5, 6) +(7, 15) +(23, 24) +(14, 25) +(8, 12) +(2, 5) +(0, 6) +(12, 13) +(8, 24) +(14, 17) +(3, 23) +(8, 14) +(4, 13) +(5, 10) +(24, 25) +(6, 21) +(0, 16) +(19, 21) +(10, 20) +(5, 22) +(1, 6) +(16, 18) +(9, 14) +(4, 15) +(2, 21) +(5, 12) +(6, 23) +(0, 20) +(1, 19) +(3, 22) +(2, 14) +(10, 22) +(0, 15) +(8, 21) +(1, 24) +(4, 22) +(6, 15) +(10, 11) +(18, 21) +(23, 24) +(10, 25) +(8, 22) +(1, 11) +(8, 18) +(1, 7) +(3, 11) +(1, 4) +(3, 16) +(7, 15) +(7, 8) +(1, 2) +(16, 19) +(3, 25) +(19, 24) +(6, 8) +(1, 9) +(3, 18) +(10, 16) +(3, 14) +(10, 15) +(12, 16) +(9, 13) +(18, 25) +(11, 24) +(0, 10) +(11, 14) +(3, 12) +(18, 21) +(16, 19) +(19, 23) +(0, 16) +(7, 14) +(8, 10) +(8, 20) +(14, 25) +(1, 23) +(10, 17) +(16, 19) +(1, 5) +(7, 19) +(13, 17) +(0, 16) +(2, 5) +(13, 19) +(1, 20) +(4, 5) +(1, 9) +(2, 23) +(15, 23) +(5, 22) +(5, 11) +(15, 22) +(0, 11) +(5, 23) +(20, 22) +(3, 22) +(8, 23) +(3, 6) +(4, 23) +(4, 7) +(17, 23) +(6, 9) +(7, 10) +(17, 22) +(12, 23) +(4, 6) +(1, 12) +(17, 24) +(5, 10) +(7, 11) +(16, 23) +(5, 8) +(1, 11) +(10, 13) +(3, 17) +(7, 18) +(8, 13) +(6, 11) +(0, 18) +(10, 22) +(3, 24) +(7, 21) +(5, 23) +(4, 22) +(8, 18) +(0, 9) +(3, 15) +(7, 20) +(10, 13) +(5, 19) +(10, 12) +(9, 25) +(2, 20) +(4, 7) +(1, 5) +(13, 22) +(5, 19) +(12, 20) +(1, 21) +(16, 21) +(1, 7) +(5, 23) +(14, 19) +(18, 21) +(11, 14) +(9, 18) +(8, 11) +(14, 21) +(11, 19) +(1, 21) +(0, 18) +(9, 23) +(7, 18) +(1, 3) +(2, 19) +(16, 23) +(3, 5) +(7, 15) +(9, 23) +(1, 8) +(6, 16) +(4, 15) +(13, 23) +(0, 3) +(4, 21) +(3, 22) +(0, 17) +(6, 23) +(15, 16) +(12, 22) +(8, 15) +(0, 13) +(14, 16) +(7, 23) +(2, 23) +(14, 24) +(3, 12) +(7, 25) +(16, 21) +(4, 7) +(1, 25) +(2, 10) +(0, 23) +(2, 20) +(7, 22) +(4, 9) +(13, 25) +(0, 14) +(0, 24) +(7, 18) +(4, 12) +(20, 21) +(9, 23) +(1, 14) +(0, 6) +(24, 25) +(9, 13) +(11, 20) +(16, 21) +(1, 22) +(0, 3) +(10, 11) +(20, 24) +(21, 23) +(7, 16) +(8, 13) +(1, 25) +(10, 18) +(3, 16) +(2, 11) +(5, 21) +(21, 24) +(10, 17) +(3, 4) +(11, 14) +(6, 18) +(12, 18) +(3, 22) +(6, 7) +(0, 14) +(15, 24) +(6, 9) +(12, 22) +(18, 19) +(0, 21) +(3, 7) +(14, 18) +(19, 20) +(3, 15) +(9, 22) +(5, 18) +(14, 23) +(2, 5) +(12, 18) +(9, 14) +(17, 23) +(5, 21) +(16, 17) +(9, 20) +(2, 6) +(19, 20) +(10, 16) +(18, 21) +(9, 25) +(5, 13) +(13, 14) +(7, 25) +(2, 16) +(11, 21) +(19, 22) +(12, 22) +(5, 19) +(0, 13) +(7, 21) +(10, 12) +(0, 18) +(13, 17) +(1, 19) +(22, 24) +(17, 19) +(18, 25) +(11, 12) +(10, 15) +(0, 21) +(1, 8) +(12, 13) +(17, 21) +(14, 25) +(5, 15) +(0, 12) +(7, 21) +(8, 15) +(14, 18) +(6, 25) +(20, 25) +(1, 8) +(0, 24) +(14, 16) +(8, 15) +(1, 17) +(5, 24) +(0, 10) +(10, 22) +(1, 25) +(8, 12) +(4, 17) +(12, 13) +(21, 25) +(2, 8) +(23, 25) +(0, 8) +(2, 6) +(13, 15) +(16, 21) +(15, 17) +(6, 11) +(21, 24) +(3, 13) +(16, 20) +(2, 5) +(3, 7) +(17, 20) +(6, 22) +(4, 13) +(14, 15) +(5, 9) +(2, 25) +(15, 19) +(9, 10) +(5, 24) +(14, 22) +(3, 20) +(0, 6) +(12, 15) +(0, 17) +(4, 14) +(3, 5) +(19, 24) +(2, 22) +(22, 25) +(16, 19) +(7, 12) +(13, 15) +(12, 20) +(8, 22) +(20, 23) +(8, 10) +(1, 22) +(4, 12) +(10, 20) +(3, 22) +(4, 11) +(4, 9) +(8, 20) +(2, 11) +(11, 18) +(5, 9) +(9, 23) +(5, 14) +(3, 11) +(5, 20) +(4, 11) +(23, 24) +(7, 23) +(21, 24) +(12, 23) +(7, 18) +(9, 24) +(0, 21) +(14, 24) +(20, 21) +(0, 2) +(18, 25) +(11, 14) +(0, 6) +(16, 24) +(6, 14) +(10, 11) +(6, 9) +(10, 19) +(7, 11) +(11, 18) +(2, 19) +(7, 12) +(10, 16) +(7, 25) +(5, 19) +(11, 17) +(10, 21) +(16, 18) +(4, 12) +(19, 24) +(4, 22) +(9, 17) +(19, 24) +(22, 25) +(3, 9) +(4, 14) +(8, 17) +(1, 8) +(7, 25) +(17, 23) +(11, 19) +(6, 23) +(15, 19) +(8, 18) +(12, 25) +(0, 11) +(8, 17) +(22, 25) +(9, 18) +(0, 10) +(19, 21) +(14, 22) +(1, 10) +(5, 19) +(4, 18) +(0, 2) +(9, 25) +(6, 18) +(3, 5) +(9, 21) +(7, 19) +(17, 25) +(0, 13) +(13, 24) +(3, 19) +(9, 21) +(2, 5) +(14, 18) +(14, 22) +(8, 13) +(2, 9) +(5, 23) +(0, 24) +(3, 4) +(5, 9) +(20, 24) +(14, 18) +(0, 15) +(13, 17) +(2, 13) +(12, 20) +(4, 14) +(15, 21) +(0, 8) +(16, 18) +(1, 16) +(4, 24) +(21, 25) +(0, 17) +(3, 20) +(11, 12) +(7, 18) +(17, 22) +(10, 18) +(4, 19) +(5, 21) +(7, 15) +(8, 25) +(14, 24) +(11, 23) +(0, 8) +(5, 10) +(12, 22) +(11, 21) +(9, 25) +(14, 18) +(4, 21) +(0, 6) +(7, 11) +(10, 16) +(14, 17) +(3, 12) +(7, 20) +(11, 24) +(2, 14) +(17, 23) +(4, 19) +(0, 23) +(2, 11) +(5, 14) +(9, 24) +(10, 17) +(3, 4) +(3, 12) +(5, 19) +(4, 18) +(8, 9) +(6, 24) +(2, 16) +(1, 19) +(4, 9) +(13, 18) +(12, 22) +(3, 25) +(8, 14) +(5, 19) +(3, 10) +(2, 5) +(1, 19) +(1, 20) +(0, 19) +(19, 22) +(9, 20) +(1, 21) +(9, 12) +(17, 19) +(0, 21) +(9, 22) +(0, 1) +(15, 21) +(13, 17) +(12, 20) +(11, 15) +(20, 24) +(0, 25) +(9, 12) +(22, 25) +(0, 8) +(11, 16) +(7, 8) +(2, 22) +(4, 25) +(11, 15) +(0, 23) +(1, 16) +(4, 6) +(1, 23) +(11, 14) +(0, 5) +(8, 14) +(0, 22) +(4, 19) +(11, 24) +(5, 18) +(8, 16) +(4, 12) +(5, 7) +(11, 21) +(3, 22) +(0, 2) +(14, 23) +(7, 20) +(5, 11) +(3, 15) +(11, 18) +(13, 20) +(3, 25) +(6, 7) +(0, 15) +(7, 23) +(3, 20) +(8, 25) +(13, 22) +(0, 7) +(3, 24) +(3, 16) +(4, 24) +(0, 6) +(0, 8) +(6, 23) +(22, 24) +(4, 17) +(3, 16) +(12, 24) +(16, 25) +(0, 17) +(4, 23) +(18, 22) +(2, 22) +(16, 21) +(4, 12) +(8, 24) +(0, 6) +(5, 25) +(4, 13) +(2, 22) +(10, 25) +(0, 15) +(16, 18) +(3, 21) +(22, 24) +(7, 21) +(14, 15) +(0, 15) +(14, 15) +(0, 3) +(3, 23) +(15, 25) +(15, 19) +(10, 25) +(7, 10) +(2, 19) +(1, 15) +(1, 24) +(2, 16) +(6, 19) +(7, 18) +(15, 21) +(8, 10) +(18, 20) +(9, 24) +(5, 16) +(15, 24) +(2, 16) +(18, 20) +(9, 25) +(18, 22) +(4, 24) +(11, 15) +(2, 8) +(16, 20) +(4, 12) +(6, 18) +(8, 11) +(13, 16) +(7, 22) +(24, 25) +(0, 8) +(2, 18) +(16, 24) +(7, 19) +(3, 11) +(6, 14) +(0, 22) +(3, 17) +(7, 23) +(7, 19) +(4, 17) +(0, 25) +(6, 22) +(12, 23) +(16, 19) +(20, 23) +(0, 1) +(9, 16) +(19, 24) +(10, 20) +(0, 8) +(0, 12) +(9, 11) +(18, 19) +(1, 8) +(10, 25) +(5, 10) +(0, 2) +(13, 19) +(12, 24) +(17, 25) +(9, 25) +(10, 19) +(13, 14) +(0, 11) +(15, 17) +(4, 5) +(4, 23) +(15, 22) +(14, 19) +(8, 13) +(5, 21) +(7, 23) +(18, 22) +(3, 19) +(13, 17) +(8, 20) +(4, 6) +(0, 15) +(8, 11) +(6, 16) +(12, 20) +(2, 3) +(19, 23) +(11, 13) +(2, 24) +(5, 20) +(14, 23) +(4, 11) +(2, 19) +(3, 14) +(3, 6) +(4, 5) +(17, 19) +(0, 6) +(3, 8) +(14, 19) +(7, 17) +(2, 17) +(14, 23) +(0, 1) +(3, 6) +(19, 25) +(1, 10) +(0, 21) +(6, 20) +(3, 24) +(13, 23) +(15, 19) +(0, 16) +(1, 9) +(6, 10) +(18, 23) +(2, 20) +(1, 12) +(4, 18) +(2, 3) +(8, 16) +(0, 22) +(10, 13) +(1, 23) +(4, 11) +(0, 8) +(18, 22) +(1, 4) +(16, 18) +(9, 23) +(0, 24) +(11, 13) +(2, 4) +(8, 9) +(14, 23) +(11, 17) +(1, 15) +(11, 20) +(1, 25) +(2, 19) +(4, 9) +(14, 18) +(12, 17) +(14, 18) +(11, 21) +(5, 21) +(13, 14) +(5, 17) +(6, 21) +(13, 23) +(11, 13) +(6, 12) +(10, 17) +(5, 25) +(6, 23) +(15, 17) +(13, 14) +(10, 19) +(0, 12) +(0, 23) +(9, 14) +(6, 7) +(3, 15) +(7, 16) +(1, 15) +(6, 8) +(17, 23) +(1, 25) +(0, 17) +(3, 7) +(4, 6) +(13, 25) +(0, 5) +(7, 23) +(4, 21) +(1, 14) +(2, 3) +(16, 25) +(11, 14) +(5, 6) +(1, 8) +(13, 17) +(8, 20) +(1, 13) +(0, 14) +(12, 25) +(4, 17) +(4, 5) +(11, 13) +(8, 10) +(2, 17) +(3, 14) +(1, 15) +(17, 23) +(0, 4) +(4, 16) +(15, 17) +(0, 24) +(4, 13) +(16, 19) +(23, 24) +(14, 15) +(11, 19) +(13, 22) +(0, 24) +(4, 21) +(3, 16) +(1, 4) +(0, 2) +(20, 22) +(16, 24) +(5, 13) +(10, 21) +(3, 9) +(4, 23) +(6, 20) +(8, 22) +(9, 25) +(23, 24) +(8, 14) +(2, 14) +(9, 23) +(6, 8) +(14, 22) +(5, 6) +(2, 15) +(7, 8) +(11, 22) +(2, 4) +(1, 7) +(14, 25) +(14, 22) +(0, 11) +(2, 3) +(6, 25) +(0, 9) +(23, 25) +(3, 10) +(14, 20) +(1, 6) +(1, 12) +(9, 22) +(0, 19) +(10, 25) +(9, 16) +(12, 20) +(17, 19) +(0, 7) +(6, 22) +(5, 20) +(12, 18) +(1, 9) +(16, 19) +(14, 22) +(6, 8) +(4, 6) +(18, 19) +(8, 13) +(1, 11) +(17, 22) +(9, 24) +(1, 17) +(2, 13) +(6, 20) +(7, 9) +(4, 21) +(15, 20) +(10, 21) +(4, 22) +(0, 13) +(0, 24) +(5, 10) +(13, 23) +(1, 4) +(2, 22) +(14, 21) +(16, 21) +(14, 18) +(0, 15) +(13, 19) +(8, 23) +(7, 23) +(8, 25) +(3, 16) +(6, 18) +(8, 14) +(3, 11) +(6, 12) +(12, 21) +(6, 16) +(13, 14) +(18, 21) +(1, 14) +(7, 13) +(10, 14) +(4, 13) +(0, 13) +(4, 6) +(3, 10) +(9, 13) +(3, 23) +(6, 20) +(17, 20) +(3, 7) +(2, 23) +(5, 6) +(12, 23) +(7, 19) +(14, 17) +(3, 24) +(1, 2) +(6, 9) +(11, 23) +(11, 22) +(17, 23) +(22, 25) +(11, 16) +(4, 22) +(4, 10) +(4, 18) +(10, 22) +(5, 18) +(4, 24) +(1, 10) +(12, 24) +(1, 13) +(0, 10) +(12, 25) +(7, 12) +(21, 25) +(14, 25) +(10, 12) +(20, 21) +(7, 11) +(12, 18) +(1, 20) +(16, 21) +(11, 17) +(8, 10) +(6, 8) +(12, 15) +(3, 20) +(1, 19) +(4, 8) +(12, 18) +(1, 23) +(13, 23) +(6, 8) +(4, 25) +(20, 25) +(4, 15) +(6, 9) +(1, 13) +(3, 13) +(1, 23) +(6, 10) +(11, 25) +(0, 20) +(3, 5) +(18, 25) +(22, 23) +(7, 13) +(3, 20) +(4, 22) +(7, 12) +(13, 21) +(9, 25) +(5, 17) +(11, 25) +(20, 24) +(16, 17) +(6, 21) +(9, 10) +(19, 25) +(13, 21) +(16, 17) +(5, 13) +(4, 16) +(1, 17) +(7, 19) +(6, 21) +(11, 21) +(5, 24) +(1, 14) +(2, 7) +(7, 14) +(11, 25) +(16, 21) +(1, 20) +(17, 24) +(5, 12) +(15, 25) +(5, 17) +(1, 22) +(3, 24) +(12, 23) +(1, 4) +(15, 16) +(18, 23) +(13, 17) +(0, 17) +(4, 21) +(1, 10) +(19, 23) +(6, 13) +(23, 25) +(4, 22) +(8, 19) +(3, 6) +(17, 24) +(1, 11) +(13, 19) +(20, 24) +(6, 18) +(3, 6) +(17, 24) +(5, 20) +(13, 14) +(1, 3) +(21, 24) +(16, 20) +(6, 9) +(8, 16) +(11, 21) +(7, 20) +(10, 21) +(7, 12) +(9, 11) +(5, 16) +(12, 20) +(17, 21) +(9, 24) +(8, 16) +(10, 15) +(12, 21) +(1, 10) +(6, 15) +(16, 21) +(1, 7) +(5, 15) +(6, 18) +(5, 7) +(14, 18) +(2, 6) +(5, 24) +(4, 6) +(0, 2) +(6, 13) +(0, 23) +(13, 22) +(0, 2) +(3, 23) +(2, 17) +(0, 4) +(11, 13) +(14, 23) +(2, 15) +(9, 11) +(4, 19) +(1, 13) +(6, 11) +(4, 25) +(9, 18) +(2, 12) +(15, 18) +(22, 25) +(3, 11) +(4, 10) +(0, 4) +(23, 25) +(10, 21) +(14, 22) +(6, 14) +(0, 15) +(17, 25) +(9, 14) +(17, 20) +(8, 15) +(6, 11) +(0, 18) +(2, 9) +(6, 21) +(10, 17) +(18, 24) +(14, 19) +(3, 18) +(10, 23) +(11, 24) +(2, 4) +(13, 14) +(5, 19) +(5, 18) +(19, 25) +(2, 23) +(4, 9) +(10, 17) +(7, 23) +(0, 9) +(1, 19) +(4, 12) +(2, 17) +(0, 23) +(1, 16) +(14, 19) +(2, 12) +(5, 16) +(7, 23) +(2, 9) +(7, 22) +(5, 17) +(16, 18) +(17, 21) +(7, 13) +(16, 24) +(6, 21) +(4, 7) +(13, 15) +(17, 19) +(19, 20) +(1, 21) +(20, 25) +(12, 21) +(14, 19) +(1, 23) +(10, 25) +(0, 12) +(18, 20) +(16, 21) +(0, 6) +(5, 10) +(16, 22) +(2, 20) +(8, 12) +(1, 16) +(8, 13) +(7, 10) +(17, 22) +(0, 4) +(8, 23) +(2, 17) +(5, 13) +(0, 19) +(7, 20) +(8, 20) +(15, 17) +(2, 23) +(9, 19) +(0, 1) +(1, 24) +(11, 15) +(18, 19) +(0, 16) +(10, 20) +(4, 24) +(0, 14) +(15, 22) +(0, 18) +(2, 15) +(13, 14) +(14, 16) +(5, 15) +(6, 13) +(3, 16) +(6, 8) +(0, 14) +(5, 17) +(17, 25) +(4, 8) +(3, 6) +(14, 24) +(16, 19) +(14, 18) +(7, 16) +(13, 19) +(3, 20) +(6, 10) +(18, 24) +(14, 22) +(2, 13) +(24, 25) +(13, 23) +(2, 17) +(6, 25) +(17, 21) +(16, 24) +(22, 25) +(11, 24) +(13, 16) +(8, 17) +(10, 13) +(7, 25) +(8, 15) +(9, 16) +(5, 22) +(18, 25) +(4, 9) +(16, 24) +(2, 7) +(4, 5) +(11, 24) +(18, 19) +(14, 16) +(18, 21) +(0, 14) +(5, 22) +(9, 11) +(16, 25) +(21, 23) +(6, 16) +(0, 24) +(13, 25) +(11, 19) +(17, 22) +(14, 20) +(0, 7) +(12, 21) +(13, 19) +(11, 18) +(1, 16) +(2, 21) +(1, 15) +(11, 23) +(12, 25) +(6, 11) +(16, 21) +(2, 18) +(16, 25) +(4, 18) +(21, 23) +(5, 16) +(18, 24) +(13, 25) +(17, 21) +(8, 25) +(2, 16) +(13, 20) +(1, 18) +(17, 22) +(13, 24) +(3, 8) +(15, 16) +(2, 19) +(20, 23) +(11, 23) +(6, 8) +(2, 12) +(7, 16) +(13, 18) +(2, 9) +(4, 18) +(12, 25) +(12, 23) +(22, 25) +(14, 18) +(9, 19) +(2, 14) +(18, 21) +(0, 22) +(5, 25) +(4, 23) +(17, 22) +(14, 16) +(12, 23) +(5, 18) +(2, 11) +(1, 17) +(9, 18) +(20, 23) +(0, 11) +(2, 19) +(9, 25) +(17, 23) +(0, 22) +(0, 7) +(14, 22) +(1, 23) +(7, 16) +(17, 23) +(6, 14) +(7, 24) +(10, 17) +(1, 23) +(5, 16) +(5, 9) +(11, 23) +(10, 15) +(17, 18) +(4, 17) +(10, 23) +(15, 20) +(11, 13) +(0, 4) +(11, 15) +(8, 13) +(3, 23) +(12, 17) +(19, 23) +(11, 24) +(2, 3) +(8, 25) +(12, 15) +(9, 13) +(13, 22) +(6, 9) +(7, 19) +(1, 2) +(18, 25) +(8, 16) +(1, 23) +(19, 20) +(2, 15) +(8, 10) +(5, 19) +(0, 10) +(2, 24) +(8, 22) +(19, 20) +(3, 10) +(7, 22) +(0, 17) +(3, 13) +(17, 19) +(7, 8) +(0, 23) +(4, 13) +(0, 19) +(7, 12) +(23, 25) +(7, 9) +(12, 16) +(16, 25) +(7, 15) +(6, 9) +(12, 18) +(7, 13) +(4, 6) +(15, 17) +(3, 25) +(14, 15) +(13, 23) +(7, 11) +(4, 9) +(15, 19) +(0, 23) +(11, 21) +(10, 14) +(4, 17) +(18, 23) +(1, 17) +(6, 15) +(5, 15) +(4, 6) +(10, 23) +(1, 20) +(4, 14) +(9, 15) +(23, 24) +(2, 6) +(10, 22) +(2, 18) +(5, 23) +(4, 12) +(7, 14) +(5, 6) +(12, 13) +(14, 19) +(16, 18) +(2, 15) +(0, 7) +(5, 7) +(4, 13) +(6, 23) +(2, 10) +(15, 17) +(8, 19) +(11, 18) +(4, 9) +(2, 25) +(16, 18) +(14, 19) +(10, 15) +(11, 24) +(4, 10) +(13, 19) +(23, 25) +(15, 18) +(8, 18) +(10, 24) +(15, 17) +(4, 21) +(13, 22) +(19, 21) +(14, 15) +(2, 4) +(18, 23) +(10, 11) +(0, 18) +(3, 19) +(2, 25) +(14, 17) +(6, 25) +(2, 20) +(1, 14) +(3, 18) +(5, 19) +(0, 11) +(20, 22) +(15, 19) +(4, 18) +(1, 24) +(2, 17) +(7, 11) +(0, 25) +(6, 11) +(21, 24) +(13, 22) +(7, 25) +(12, 15) +(8, 17) +(10, 17) +(23, 24) +(11, 13) +(15, 20) +(2, 22) +(17, 19) +(3, 10) +(24, 25) +(2, 7) +(16, 20) +(21, 22) +(1, 20) +(3, 8) +(0, 25) +(10, 23) +(7, 14) +(2, 4) +(3, 5) +(11, 20) +(2, 13) +(1, 22) +(1, 6) +(22, 24) +(2, 14) +(4, 22) +(1, 7) +(7, 15) +(1, 6) +(22, 25) +(19, 25) +(6, 17) +(7, 17) +(4, 25) +(6, 11) +(17, 21) +(6, 8) +(3, 11) +(0, 6) +(3, 16) +(15, 17) +(3, 23) +(6, 8) +(0, 21) +(14, 15) +(12, 16) +(12, 23) +(6, 11) +(7, 15) +(14, 16) +(2, 8) +(5, 23) +(8, 9) +(10, 11) +(14, 20) +(17, 20) +(5, 14) +(9, 13) +(5, 17) +(0, 20) +(1, 13) +(7, 9) +(20, 25) +(1, 15) +(9, 12) +(13, 24) +(7, 23) +(10, 17) +(5, 11) +(14, 24) +(1, 8) +(0, 12) +(3, 9) +(11, 22) +(3, 15) +(1, 13) +(17, 22) +(5, 14) +(2, 13) +(1, 15) +(11, 22) +(11, 21) +(8, 13) +(9, 22) +(4, 9) +(10, 13) +(20, 21) +(8, 23) +(2, 4) +(16, 20) +(19, 21) +(10, 24) +(13, 19) +(1, 16) +(3, 10) +(5, 20) +(12, 19) +(13, 14) +(5, 7) +(3, 8) +(20, 23) +(16, 18) +(20, 25) +(16, 17) +(6, 7) +(13, 23) +(5, 8) +(7, 15) +(6, 11) +(3, 11) +(5, 15) +(7, 18) +(14, 15) +(5, 24) +(1, 11) +(1, 7) +(5, 21) +(15, 18) +(8, 21) +(9, 18) +(9, 24) +(13, 21) +(8, 25) +(8, 15) +(14, 24) +(10, 21) +(3, 13) +(1, 3) +(4, 15) +(5, 21) +(11, 13) +(8, 20) +(11, 14) +(1, 9) +(15, 19) +(4, 23) +(20, 22) +(13, 17) +(2, 3) +(12, 19) +(11, 20) +(17, 25) +(1, 7) +(13, 21) +(6, 23) +(4, 20) +(13, 15) +(18, 19) +(1, 25) +(14, 17) +(7, 9) +(8, 23) +(3, 20) +(16, 19) +(6, 14) +(8, 9) +(18, 23) +(0, 13) +(7, 21) +(4, 19) +(5, 16) +(3, 6) +(8, 25) +(15, 20) +(11, 21) +(2, 16) +(5, 23) +(1, 4) +(6, 10) +(7, 19) +(21, 22) +(15, 25) +(0, 19) +(11, 25) +(15, 18) +(1, 20) +(20, 24) +(9, 25) +(1, 7) +(4, 18) +(6, 15) +(0, 10) +(11, 16) +(3, 4) +(12, 24) +(6, 11) +(5, 18) +(2, 10) +(8, 20) +(2, 13) +(5, 8) +(10, 21) +(1, 12) +(17, 24) +(0, 20) +(0, 16) +(10, 23) +(9, 24) +(7, 8) +(20, 22) +(6, 12) +(3, 5) +(16, 24) +(7, 20) +(6, 8) +(3, 23) +(7, 25) +(8, 15) +(3, 14) +(19, 25) +(3, 15) +(8, 15) +(21, 25) +(6, 21) +(3, 15) +(15, 20) +(12, 20) +(15, 18) +(17, 20) +(15, 16) +(0, 12) +(18, 22) +(18, 19) +(13, 15) +(17, 24) +(16, 22) +(16, 25) +(5, 22) +(12, 19) +(1, 16) +(21, 25) +(2, 5) +(10, 22) +(18, 21) +(5, 9) +(2, 20) +(7, 22) +(5, 22) +(9, 12) +(2, 4) +(11, 20) +(12, 14) +(2, 16) +(10, 20) +(22, 25) +(4, 13) +(9, 14) +(4, 7) +(2, 24) +(1, 25) +(3, 22) +(6, 10) +(2, 21) +(19, 22) +(3, 13) +(6, 15) +(0, 24) +(10, 18) +(11, 15) +(7, 18) +(19, 20) +(4, 21) +(2, 8) +(2, 4) +(15, 18) +(19, 23) +(12, 21) +(1, 7) +(0, 1) +(2, 25) +(5, 7) +(12, 20) +(2, 13) +(7, 11) +(22, 25) +(12, 25) +(15, 22) +(1, 7) +(13, 14) +(2, 17) +(9, 17) +(5, 15) +(22, 24) +(8, 9) +(13, 24) +(2, 22) +(5, 24) +(2, 11) +(3, 9) +(8, 21) +(9, 20) +(3, 18) +(2, 7) +(7, 24) +(3, 12) +(8, 20) +(18, 25) +(3, 25) +(8, 17) +(1, 12) +(10, 20) +(17, 20) +(10, 12) +(6, 25) +(3, 17) +(8, 20) +(10, 19) +(12, 21) +(0, 25) +(6, 7) +(0, 1) +(4, 19) +(22, 25) +(21, 24) +(6, 14) +(6, 20) +(15, 19) +(0, 23) +(9, 24) +(5, 14) +(21, 22) +(2, 15) +(0, 10) +(9, 20) +(3, 19) +(13, 23) +(18, 22) +(23, 25) +(10, 19) +(12, 15) +(3, 24) +(1, 24) +(10, 17) +(12, 16) +(2, 15) +(13, 15) +(2, 4) +(1, 3) +(20, 24) +(17, 25) +(15, 16) +(10, 13) +(1, 6) +(12, 24) +(3, 23) +(2, 11) +(1, 19) +(11, 20) +(3, 13) +(4, 15) +(16, 17) +(0, 2) +(6, 9) +(1, 15) +(11, 14) +(6, 8) +(4, 7) +(13, 25) +(16, 20) +(10, 15) +(18, 25) +(2, 4) +(6, 11) +(1, 24) +(1, 3) +(10, 23) +(19, 25) +(2, 10) +(1, 5) +(21, 25) +(3, 12) +(3, 4) +(10, 22) +(19, 25) +(2, 8) +(1, 14) +(13, 21) +(19, 20) +(7, 10) +(5, 21) +(11, 22) +(3, 8) +(19, 24) +(15, 20) +(0, 10) +(9, 22) +(3, 17) +(7, 20) +(4, 22) +(12, 17) +(10, 13) +(24, 25) +(2, 9) +(1, 15) +(17, 22) +(10, 18) +(11, 25) +(3, 12) +(0, 2) +(7, 13) +(2, 23) +(12, 24) +(0, 14) +(10, 16) +(9, 25) +(8, 17) +(2, 18) +(10, 15) +(6, 25) +(11, 17) +(14, 21) +(6, 18) +(2, 8) +(23, 25) +(11, 19) +(16, 21) +(15, 20) +(9, 15) +(0, 21) +(10, 25) +(14, 23) +(1, 16) +(16, 17) +(5, 16) +(0, 17) +(13, 17) +(5, 7) +(0, 19) +(16, 23) +(7, 22) +(2, 17) +(10, 16) +(12, 19) +(3, 5) +(15, 23) +(1, 22) +(7, 24) +(5, 8) +(3, 6) +(14, 22) +(6, 20) +(2, 24) +(2, 17) +(11, 22) +(4, 24) +(6, 8) +(3, 20) +(8, 9) +(19, 20) +(1, 22) +(0, 3) +(10, 22) +(9, 25) +(4, 19) +(18, 25) +(10, 13) +(8, 19) +(4, 24) +(0, 24) +(5, 19) +(2, 4) +(23, 25) +(0, 20) +(4, 12) +(17, 19) +(5, 8) +(1, 20) +(4, 11) +(5, 6) +(13, 20) +(5, 19) +(4, 17) +(1, 16) +(20, 22) +(9, 17) +(13, 24) +(15, 16) +(20, 25) +(13, 18) +(2, 22) +(16, 23) +(5, 13) +(9, 20) +(18, 24) +(1, 2) +(16, 25) +(18, 22) +(2, 6) +(1, 12) +(7, 12) +(3, 6) +(10, 22) +(1, 8) +(22, 23) +(0, 7) +(1, 12) +(18, 23) +(1, 24) +(0, 7) +(18, 19) +(7, 24) +(13, 23) +(0, 8) +(1, 6) +(8, 12) +(6, 16) +(7, 10) +(0, 15) +(0, 24) +(2, 12) +(7, 15) +(3, 6) +(2, 8) +(5, 24) +(4, 15) +(0, 16) +(8, 13) +(5, 7) +(4, 21) +(0, 25) +(14, 16) +(9, 24) +(8, 10) +(9, 25) +(0, 11) +(3, 14) +(21, 24) +(4, 17) +(7, 18) +(3, 22) +(0, 12) +(7, 8) +(4, 19) +(16, 24) +(18, 23) +(15, 17) +(1, 24) +(4, 7) +(20, 23) +(19, 22) +(16, 17) +(1, 15) +(18, 20) +(21, 23) +(10, 15) +(16, 18) +(14, 20) +(2, 23) +(7, 16) +(15, 24) +(1, 2) +(20, 25) +(14, 16) +(1, 6) +(7, 20) +(9, 24) +(14, 18) +(5, 9) +(2, 6) +(1, 4) +(4, 21) +(14, 25) +(1, 23) +(5, 11) +(9, 10) +(11, 16) +(9, 17) +(23, 24) +(10, 17) +(7, 11) +(0, 23) +(15, 24) +(9, 12) +(6, 24) +(15, 21) +(17, 19) +(4, 10) +(4, 22) +(20, 21) +(2, 15) +(7, 19) +(2, 3) +(15, 23) +(3, 6) +(0, 15) +(8, 23) +(2, 10) +(3, 4) +(6, 13) +(8, 15) +(0, 7) +(10, 21) +(2, 10) +(7, 24) +(12, 15) +(1, 15) +(8, 24) +(12, 19) +(1, 5) +(3, 19) +(7, 24) +(3, 18) +(8, 24) +(19, 21) +(5, 23) +(23, 25) +(5, 9) +(15, 24) +(8, 17) +(13, 17) +(9, 25) +(8, 11) +(0, 5) +(19, 23) +(15, 20) +(5, 9) +(6, 17) +(8, 13) +(1, 20) +(2, 6) +(10, 20) +(4, 8) +(14, 17) +(11, 20) +(8, 13) +(6, 24) +(4, 8) +(13, 25) +(2, 11) +(8, 14) +(4, 8) +(4, 22) +(8, 25) +(4, 15) +(3, 8) +(15, 18) +(4, 7) +(4, 16) +(12, 18) +(7, 19) +(15, 22) +(18, 22) +(6, 7) +(15, 17) +(4, 21) +(3, 12) +(5, 21) +(20, 22) +(3, 7) +(13, 17) +(16, 17) +(1, 22) +(7, 19) +(15, 20) +(10, 17) +(11, 15) +(2, 22) +(1, 2) +(4, 22) +(16, 17) +(11, 14) +(0, 15) +(3, 16) +(5, 11) +(21, 22) +(6, 14) +(0, 6) +(16, 17) +(3, 16) +(17, 20) +(9, 20) +(4, 17) +(9, 21) +(17, 24) +(4, 16) +(15, 24) +(17, 24) +(15, 23) +(8, 17) +(13, 23) +(11, 17) +(8, 16) +(4, 17) +(11, 13) +(8, 19) +(8, 10) +(11, 15) +(2, 17) +(19, 22) +(1, 22) +(19, 24) +(13, 17) +(2, 12) +(5, 13) +(6, 17) +(3, 12) +(2, 25) +(2, 10) +(11, 12) +(1, 6) +(5, 24) +(3, 16) +(11, 14) +(12, 22) +(8, 24) +(15, 16) +(9, 10) +(3, 21) +(6, 19) +(16, 23) +(15, 20) +(6, 17) +(11, 19) +(17, 22) +(9, 19) +(3, 11) +(6, 14) +(0, 17) +(19, 25) +(6, 10) +(11, 21) +(7, 14) +(4, 10) +(6, 9) +(13, 21) +(14, 16) +(3, 17) +(6, 24) +(7, 9) +(2, 16) +(20, 21) +(12, 14) +(11, 14) +(8, 20) +(9, 25) +(16, 22) +(2, 18) +(16, 20) +(6, 11) +(9, 21) +(16, 24) +(6, 12) +(6, 14) +(13, 24) +(16, 25) +(5, 12) +(14, 17) +(1, 13) +(10, 25) +(12, 23) +(6, 16) +(0, 10) +(3, 14) +(4, 16) +(22, 23) +(3, 7) +(2, 23) +(14, 20) +(16, 18) +(3, 24) +(6, 20) +(7, 12) +(17, 24) +(3, 8) +(6, 10) +(17, 19) +(11, 24) +(0, 6) +(10, 13) +(3, 20) +(9, 19) +(8, 20) +(0, 24) +(11, 16) +(17, 22) +(11, 15) +(12, 20) +(1, 22) +(3, 19) +(17, 22) +(1, 2) +(3, 13) +(1, 2) +(5, 22) +(3, 9) +(16, 17) +(4, 5) +(22, 24) +(1, 15) +(6, 22) +(0, 15) +(14, 24) +(3, 5) +(1, 13) +(8, 22) +(18, 24) +(3, 11) +(1, 16) +(17, 22) +(18, 19) +(7, 24) +(16, 23) +(0, 24) +(8, 16) +(13, 22) +(7, 19) +(9, 19) +(17, 22) +(13, 14) +(16, 23) +(24, 25) +(9, 18) +(12, 17) +(7, 14) +(21, 22) +(16, 19) +(2, 13) +(13, 24) +(1, 9) +(11, 14) +(7, 20) +(4, 24) +(11, 21) +(7, 23) +(1, 18) +(0, 20) +(14, 21) +(3, 20) +(11, 21) +(0, 3) +(12, 14) +(3, 22) +(12, 20) +(13, 21) +(10, 11) +(4, 14) +(4, 20) +(15, 21) +(3, 6) +(8, 13) +(0, 21) +(6, 22) +(1, 4) +(14, 15) +(3, 19) +(8, 9) +(0, 25) +(1, 24) +(9, 23) +(8, 15) +(2, 19) +(15, 20) +(0, 14) +(5, 23) +(3, 8) +(6, 19) +(9, 10) +(8, 9) +(6, 11) +(20, 24) +(10, 21) +(2, 23) +(10, 12) +(6, 13) +(1, 21) +(2, 14) +(17, 23) +(12, 13) +(18, 23) +(17, 25) +(0, 10) +(14, 24) +(6, 24) +(14, 16) +(5, 18) +(4, 10) +(9, 24) +(5, 12) +(6, 19) +(4, 18) +(10, 11) +(12, 17) +(3, 19) +(1, 18) +(4, 20) +(10, 23) +(6, 7) +(5, 17) +(10, 16) +(6, 22) +(1, 11) +(2, 12) +(12, 23) +(4, 17) +(2, 13) +(5, 8) +(5, 18) +(4, 7) +(11, 12) +(10, 13) +(0, 23) +(13, 15) +(1, 10) +(16, 23) +(5, 9) +(3, 7) +(1, 25) +(10, 20) +(15, 21) +(5, 6) +(2, 23) +(16, 18) +(9, 24) +(19, 21) +(2, 24) +(9, 20) +(12, 16) +(6, 25) +(0, 5) +(1, 14) +(18, 19) +(6, 8) +(7, 21) +(5, 14) +(13, 25) +(16, 23) +(0, 2) +(2, 8) +(1, 6) +(3, 14) +(5, 21) +(24, 25) +(12, 18) +(13, 17) +(12, 22) +(2, 16) +(14, 21) +(6, 9) +(8, 25) +(10, 17) +(8, 16) +(4, 6) +(10, 21) +(2, 5) +(14, 19) +(17, 18) +(0, 8) +(14, 22) +(16, 20) +(15, 19) +(3, 17) +(7, 18) +(7, 13) +(17, 23) +(15, 24) +(3, 22) +(18, 19) +(12, 13) +(4, 24) +(5, 23) +(19, 21) +(1, 17) +(12, 18) +(5, 14) +(15, 17) +(20, 23) +(8, 18) +(7, 17) +(14, 16) +(12, 15) +(18, 19) +(7, 25) +(11, 16) +(0, 15) +(1, 14) +(16, 21) +(17, 18) +(0, 11) +(13, 15) +(3, 15) +(0, 23) +(8, 23) +(0, 9) +(9, 11) +(0, 22) +(5, 8) +(1, 22) +(0, 23) +(6, 8) +(11, 14) +(14, 15) +(8, 20) +(1, 23) +(3, 22) +(3, 21) +(19, 23) +(8, 11) +(17, 20) +(6, 22) +(3, 16) +(6, 21) +(23, 25) +(4, 17) +(17, 25) +(6, 21) +(4, 15) +(11, 23) +(3, 9) +(6, 14) +(17, 21) +(3, 25) +(9, 23) +(5, 11) +(14, 18) +(4, 5) +(3, 10) +(9, 20) +(1, 23) +(6, 15) +(0, 25) +(2, 11) +(0, 7) +(15, 21) +(14, 19) +(4, 8) +(1, 2) +(22, 23) +(14, 20) +(4, 15) +(2, 9) +(16, 22) +(5, 23) +(0, 13) +(1, 3) +(6, 8) +(8, 19) +(5, 17) +(14, 23) +(6, 11) +(10, 14) +(2, 6) +(11, 21) +(5, 25) +(3, 17) +(8, 16) +(14, 20) +(6, 22) +(10, 17) +(16, 18) +(9, 11) +(7, 25) +(2, 24) +(1, 24) +(0, 10) +(18, 25) +(4, 9) +(14, 23) +(3, 22) +(2, 16) +(6, 15) +(11, 12) +(10, 23) +(3, 13) +(1, 15) +(6, 11) +(4, 8) +(0, 14) +(21, 25) +(3, 6) +(11, 16) +(23, 24) +(9, 25) +(2, 15) +(4, 18) +(7, 21) +(14, 25) +(6, 17) +(13, 15) +(11, 23) +(12, 25) +(2, 15) +(1, 14) +(14, 22) +(7, 12) +(1, 10) +(2, 3) +(13, 15) +(5, 15) +(4, 7) +(13, 18) +(1, 2) +(3, 25) +(7, 20) +(5, 6) +(4, 19) +(15, 22) +(11, 25) +(18, 20) +(8, 25) +(4, 24) +(9, 22) +(8, 16) +(9, 10) +(2, 20) +(24, 25) +(1, 22) +(7, 18) +(6, 10) +(4, 7) +(16, 22) +(12, 18) +(7, 24) +(11, 18) +(5, 12) +(8, 16) +(5, 21) +(15, 18) +(8, 9) +(6, 16) +(1, 11) +(7, 19) +(1, 6) +(18, 20) +(8, 21) +(15, 25) +(7, 17) +(1, 10) +(2, 20) +(12, 15) +(18, 24) +(23, 25) +(5, 23) +(15, 16) +(9, 24) +(16, 23) +(2, 24) +(14, 15) +(5, 7) +(5, 25) +(7, 17) +(4, 23) +(7, 22) +(4, 25) +(15, 23) +(14, 15) +(0, 7) +(19, 22) +(18, 25) +(4, 11) +(9, 23) +(15, 16) +(4, 18) +(8, 25) +(5, 23) +(3, 14) +(4, 24) +(11, 18) +(14, 17) +(1, 15) +(10, 25) +(5, 11) +(21, 25) +(6, 14) +(15, 19) +(8, 17) +(10, 17) +(7, 8) +(2, 15) +(6, 12) +(1, 5) +(0, 14) +(0, 22) +(17, 18) +(6, 13) +(7, 11) +(15, 16) +(3, 13) +(2, 15) +(0, 12) +(6, 9) +(1, 22) +(0, 18) +(4, 12) +(2, 5) +(15, 16) +(11, 13) +(1, 17) +(3, 20) +(4, 20) +(18, 22) +(5, 6) +(2, 8) +(11, 13) +(13, 14) +(1, 11) +(10, 18) +(4, 22) +(8, 12) +(1, 8) +(4, 9) +(14, 24) +(13, 15) +(3, 24) +(6, 15) +(9, 11) +(1, 5) +(13, 16) +(2, 13) +(4, 15) +(8, 16) +(4, 20) +(0, 13) +(2, 17) +(16, 19) +(13, 24) +(0, 22) +(2, 7) +(4, 14) +(5, 20) +(9, 17) +(0, 3) +(6, 17) +(10, 20) +(2, 8) +(14, 23) +(8, 20) +(2, 25) +(9, 23) +(6, 13) +(3, 24) +(10, 15) +(18, 20) +(22, 24) +(0, 10) +(4, 15) +(9, 25) +(1, 9) +(8, 22) +(2, 10) +(15, 17) +(14, 24) +(4, 12) +(7, 9) +(15, 20) +(4, 23) +(12, 16) +(16, 19) +(6, 20) +(7, 21) +(11, 12) +(8, 23) +(13, 15) +(4, 5) +(1, 4) +(10, 13) +(19, 25) +(9, 19) +(1, 3) +(4, 21) +(9, 17) +(1, 12) +(3, 22) +(12, 22) +(3, 15) +(1, 3) +(15, 23) +(23, 25) +(1, 2) +(3, 9) +(14, 25) +(2, 3) +(1, 15) +(16, 23) +(2, 20) +(8, 16) +(1, 4) +(13, 15) +(1, 5) +(15, 24) +(4, 23) +(10, 16) +(8, 21) +(8, 13) +(5, 19) +(4, 18) +(14, 21) +(10, 24) +(19, 23) +(17, 24) +(4, 6) +(5, 15) +(13, 20) +(4, 8) +(17, 18) +(2, 15) +(1, 19) +(5, 6) +(1, 12) +(4, 15) +(2, 11) +(7, 8) +(9, 19) +(5, 21) +(2, 25) +(8, 10) +(6, 7) +(5, 24) +(0, 12) +(16, 25) +(10, 21) +(2, 20) +(6, 8) +(7, 22) +(21, 24) +(5, 8) +(6, 19) +(4, 10) +(1, 22) +(16, 18) +(3, 8) +(12, 19) +(6, 24) +(5, 22) +(4, 7) +(1, 15) +(15, 23) +(8, 17) +(13, 19) +(6, 16) +(2, 23) +(14, 15) +(2, 9) +(14, 20) +(7, 23) +(2, 24) +(9, 21) +(13, 23) +(4, 20) +(7, 22) +(14, 25) +(4, 19) +(5, 9) +(6, 21) +(7, 20) +(10, 23) +(18, 25) +(1, 22) +(7, 21) +(13, 18) +(17, 22) +(1, 11) +(0, 5) +(15, 25) +(8, 17) +(23, 25) +(5, 12) +(3, 15) +(7, 17) +(3, 10) +(20, 25) +(6, 23) +(2, 15) +(8, 10) +(7, 18) +(2, 14) +(6, 11) +(2, 15) +(6, 19) +(11, 23) +(5, 8) +(4, 19) +(2, 14) +(5, 13) +(6, 8) +(0, 11) +(15, 16) +(14, 20) +(6, 10) +(0, 9) +(3, 16) +(2, 12) +(3, 11) +(14, 25) +(10, 13) +(1, 2) +(12, 21) +(6, 14) +(23, 25) +(0, 12) +(23, 24) +(15, 25) +(0, 2) +(4, 14) +(14, 16) +(4, 17) +(20, 25) +(8, 23) +(7, 15) +(7, 12) +(6, 23) +(8, 19) +(21, 23) +(5, 6) +(8, 18) +(19, 21) +(14, 18) +(22, 23) +(5, 15) +(12, 19) +(13, 22) +(8, 21) +(11, 18) +(5, 8) +(13, 23) +(18, 25) +(7, 22) +(4, 23) +(13, 15) +(21, 22) +(15, 16) +(13, 18) +(4, 11) +(15, 19) +(0, 16) +(15, 17) +(10, 16) +(6, 19) +(1, 10) +(2, 17) +(18, 19) +(6, 7) +(3, 15) +(2, 11) +(7, 12) +(13, 18) +(8, 17) +(15, 23) +(5, 10) +(6, 22) +(3, 14) +(18, 19) +(8, 17) +(5, 15) +(11, 22) +(8, 17) +(2, 19) +(15, 21) +(8, 10) +(1, 17) +(2, 14) +(10, 15) +(8, 22) +(13, 17) +(2, 3) +(3, 4) +(17, 24) +(5, 10) +(15, 25) +(9, 13) +(16, 17) +(20, 24) +(6, 9) +(7, 13) +(0, 25) +(7, 8) +(5, 16) +(0, 3) +(17, 19) +(6, 12) +(9, 12) +(8, 14) +(6, 24) +(2, 5) +(1, 7) +(17, 23) +(0, 23) +(7, 22) +(1, 6) +(9, 21) +(13, 14) +(8, 12) +(5, 16) +(4, 21) +(13, 19) +(8, 20) +(10, 12) +(9, 24) +(2, 5) +(1, 8) +(4, 10) +(15, 24) +(9, 18) +(11, 20) +(16, 21) +(5, 22) +(5, 7) +(22, 25) +(20, 21) +(6, 11) +(8, 10) +(14, 18) +(2, 11) +(3, 5) +(16, 25) +(13, 14) +(10, 25) +(2, 6) +(3, 4) +(11, 24) +(21, 24) +(5, 6) +(1, 2) +(5, 22) +(9, 24) +(2, 23) +(6, 17) +(1, 16) +(2, 14) +(21, 22) +(4, 9) +(1, 18) +(6, 19) +(5, 16) +(7, 24) +(0, 19) +(1, 2) +(13, 21) +(17, 22) +(14, 16) +(0, 3) +(17, 18) +(2, 6) +(20, 22) +(1, 8) +(16, 23) +(14, 21) +(9, 19) +(16, 25) +(0, 20) +(2, 15) +(9, 22) +(3, 17) +(19, 20) +(0, 3) +(9, 16) +(15, 22) +(2, 23) +(0, 1) +(12, 23) +(3, 5) +(13, 23) +(0, 5) +(3, 17) +(4, 12) +(1, 10) +(13, 14) +(6, 10) +(1, 4) +(4, 9) +(13, 19) +(1, 11) +(6, 15) +(14, 20) +(11, 24) +(7, 13) +(10, 14) +(15, 16) +(8, 19) +(6, 14) +(24, 25) +(11, 22) +(0, 22) +(1, 25) +(23, 24) +(11, 15) +(2, 6) +(0, 20) +(6, 10) +(1, 17) +(14, 15) +(9, 25) +(17, 24) +(9, 18) +(12, 20) +(3, 6) +(0, 16) +(1, 25) +(19, 20) +(3, 5) +(6, 21) +(9, 20) +(21, 22) +(6, 17) +(3, 11) +(5, 24) +(2, 19) +(20, 22) +(5, 6) +(8, 11) +(2, 7) +(15, 19) +(2, 24) +(5, 12) +(0, 11) +(6, 14) +(10, 15) +(0, 16) +(5, 7) +(14, 24) +(16, 19) +(0, 25) +(0, 18) +(16, 17) +(16, 25) +(17, 25) +(16, 19) +(18, 19) +(1, 17) +(24, 25) +(13, 16) +(15, 24) +(3, 16) +(17, 21) +(1, 9) +(0, 17) +(8, 24) +(2, 21) +(1, 15) +(10, 21) +(3, 17) +(9, 24) +(8, 22) +(9, 24) +(3, 15) +(16, 21) +(17, 18) +(8, 19) +(9, 17) +(12, 24) +(18, 23) +(18, 21) +(9, 20) +(16, 17) +(12, 15) +(13, 15) +(10, 20) +(0, 17) +(9, 14) +(14, 24) +(2, 13) +(6, 10) +(0, 3) +(20, 25) +(6, 17) +(7, 14) +(18, 25) +(19, 24) +(10, 22) +(11, 24) +(0, 22) +(16, 18) +(8, 19) +(15, 25) +(5, 6) +(12, 16) +(3, 5) +(4, 18) +(1, 6) +(14, 24) +(15, 20) +(2, 4) +(15, 18) +(13, 24) +(3, 22) +(2, 9) +(5, 24) +(13, 14) +(4, 19) +(18, 19) +(4, 8) +(9, 12) +(9, 22) +(3, 19) +(12, 23) +(4, 11) +(12, 24) +(10, 11) +(6, 23) +(10, 16) +(16, 21) +(10, 14) +(11, 16) +(20, 21) +(10, 20) +(8, 11) +(14, 21) +(15, 16) +(0, 16) +(14, 15) +(5, 10) +(8, 13) +(7, 11) +(13, 24) +(0, 20) +(2, 7) +(1, 11) +(0, 16) +(2, 18) +(5, 24) +(1, 6) +(7, 25) +(1, 17) +(16, 21) +(6, 8) +(5, 12) +(0, 11) +(19, 25) +(11, 24) +(6, 10) +(21, 22) +(12, 13) +(5, 11) +(12, 22) +(0, 24) +(13, 21) +(4, 10) +(2, 6) +(3, 6) +(18, 24) +(18, 23) +(6, 9) +(3, 19) +(11, 19) +(9, 16) +(6, 14) +(16, 24) +(2, 6) +(3, 14) +(9, 23) +(6, 7) +(9, 14) +(15, 16) +(2, 13) +(9, 24) +(13, 18) +(8, 16) +(4, 7) +(2, 10) +(0, 6) +(7, 21) +(1, 2) +(5, 18) +(13, 15) +(6, 20) +(0, 17) +(6, 15) +(1, 22) +(2, 16) +(3, 21) +(17, 19) +(14, 18) +(0, 4) +(0, 25) +(11, 16) +(18, 22) +(2, 19) +(12, 21) +(6, 20) +(8, 15) +(21, 25) +(9, 18) +(8, 13) +(0, 16) +(4, 20) +(5, 16) +(0, 19) +(13, 20) +(3, 21) +(12, 25) +(9, 24) +(10, 12) +(11, 16) +(2, 3) +(14, 21) +(8, 25) +(1, 20) +(9, 18) +(4, 25) +(21, 24) +(10, 23) +(11, 12) +(8, 17) +(17, 22) +(3, 8) +(2, 25) +(1, 21) +(10, 12) +(18, 23) +(7, 10) +(2, 3) +(18, 19) +(1, 25) +(16, 23) +(0, 22) +(4, 18) +(15, 19) +(0, 16) +(14, 22) +(3, 19) +(2, 14) +(14, 19) +(2, 13) +(14, 18) +(2, 21) +(19, 20) +(13, 15) +(4, 15) +(3, 21) +(2, 10) +(6, 19) +(11, 20) +(3, 13) +(15, 22) +(4, 20) +(0, 21) +(1, 22) +(21, 24) +(11, 15) +(4, 5) +(3, 16) +(9, 11) +(3, 19) +(5, 21) +(4, 12) +(8, 15) +(8, 11) +(3, 15) +(4, 25) +(2, 21) +(6, 8) +(12, 21) +(1, 25) +(13, 21) +(12, 23) +(18, 23) +(5, 13) +(4, 18) +(5, 21) +(12, 13) +(2, 23) +(17, 18) +(12, 20) +(3, 4) +(0, 2) +(21, 24) +(5, 19) +(15, 18) +(0, 17) +(6, 20) +(14, 24) +(2, 5) +(10, 20) +(0, 1) +(8, 14) +(15, 16) +(2, 9) +(5, 25) +(19, 24) +(12, 18) +(11, 17) +(7, 16) +(0, 5) +(1, 3) +(11, 25) +(4, 25) +(15, 16) +(7, 22) +(11, 20) +(15, 22) +(7, 12) +(0, 4) +(16, 17) +(12, 24) +(8, 17) +(7, 23) +(13, 16) +(3, 22) +(15, 25) +(12, 14) +(5, 8) +(22, 23) +(2, 16) +(9, 17) +(11, 12) +(16, 21) +(8, 10) +(16, 18) +(1, 8) +(10, 18) +(16, 19) +(1, 17) +(17, 25) +(0, 16) +(5, 18) +(13, 19) +(6, 18) +(3, 5) +(0, 15) +(2, 6) +(18, 24) +(2, 4) +(20, 24) +(2, 16) +(8, 20) +(10, 24) +(4, 20) +(2, 22) +(19, 24) +(8, 9) +(2, 9) +(13, 19) +(10, 24) +(13, 18) +(14, 19) +(2, 12) +(13, 20) +(18, 23) +(14, 22) +(9, 18) +(21, 23) +(6, 22) +(4, 20) +(18, 24) +(20, 21) +(4, 11) +(9, 20) +(3, 4) +(14, 24) +(11, 13) +(11, 22) +(9, 21) +(4, 25) +(3, 12) +(8, 20) +(9, 23) +(2, 25) +(3, 13) +(0, 8) +(22, 25) +(8, 16) +(2, 19) +(0, 15) +(10, 22) +(8, 13) +(6, 16) +(0, 21) +(16, 19) +(8, 11) +(6, 17) +(2, 8) +(4, 6) +(4, 8) +(6, 21) +(6, 16) +(4, 9) +(13, 21) +(1, 13) +(9, 14) +(6, 19) +(12, 16) +(3, 21) +(2, 12) +(6, 18) +(0, 14) +(7, 13) +(10, 14) +(0, 16) +(18, 23) +(8, 23) +(0, 3) +(16, 24) +(10, 16) +(8, 9) +(17, 23) +(1, 17) +(8, 25) +(2, 9) +(1, 11) +(2, 14) +(5, 9) +(8, 20) +(5, 6) +(14, 24) +(9, 19) +(11, 16) +(12, 20) +(8, 14) +(11, 22) +(10, 20) +(24, 25) +(6, 19) +(3, 5) +(3, 17) +(14, 20) +(5, 23) +(15, 24) +(16, 25) +(5, 21) +(3, 13) +(12, 15) +(19, 23) +(9, 24) +(22, 25) +(15, 18) +(5, 8) +(16, 21) +(9, 12) +(2, 21) +(7, 15) +(12, 20) +(0, 8) +(0, 1) +(8, 20) +(3, 15) +(7, 14) +(12, 19) +(7, 25) +(18, 19) +(2, 12) +(8, 14) +(3, 10) +(1, 12) +(5, 10) +(14, 23) +(24, 25) +(3, 9) +(12, 23) +(5, 13) +(9, 17) +(3, 25) +(9, 11) +(0, 25) +(8, 13) +(17, 20) +(9, 16) +(14, 17) +(20, 24) +(5, 16) +(20, 21) +(4, 9) +(9, 18) +(4, 13) +(1, 5) +(10, 16) +(2, 18) +(3, 5) +(16, 22) +(4, 23) +(2, 14) +(4, 23) +(11, 22) +(5, 6) +(16, 17) +(5, 17) +(2, 6) +(8, 16) +(9, 22) +(4, 5) +(16, 22) +(1, 9) +(19, 22) +(1, 15) +(10, 19) +(3, 22) +(7, 15) +(1, 14) +(3, 11) +(19, 24) +(1, 6) +(10, 16) +(12, 22) +(4, 19) +(3, 20) +(16, 23) +(11, 23) +(3, 13) +(16, 17) +(6, 13) +(3, 10) +(1, 23) +(12, 16) +(17, 18) +(9, 23) +(16, 24) +(0, 17) +(12, 25) +(6, 21) +(8, 18) +(2, 18) +(13, 25) +(5, 9) +(10, 23) +(12, 14) +(17, 20) +(6, 20) +(12, 15) +(1, 17) +(0, 15) +(6, 10) +(3, 20) +(4, 6) +(3, 12) +(11, 20) +(0, 19) +(8, 19) +(16, 20) +(3, 22) +(11, 12) +(6, 9) +(6, 23) +(4, 8) +(7, 19) +(5, 9) +(9, 10) +(8, 15) +(4, 17) +(0, 7) +(5, 11) +(0, 17) +(2, 11) +(4, 20) +(6, 9) +(11, 21) +(9, 10) +(6, 12) +(6, 16) +(8, 9) +(3, 10) +(3, 23) +(6, 22) +(0, 16) +(0, 7) +(12, 16) +(3, 9) +(7, 24) +(0, 19) +(15, 19) +(7, 8) +(22, 24) +(0, 24) +(19, 25) +(15, 23) +(3, 8) +(3, 13) +(10, 23) +(0, 25) +(9, 13) +(3, 11) +(6, 25) +(19, 23) +(16, 19) +(0, 25) +(11, 24) +(13, 21) +(10, 23) +(9, 15) +(3, 21) +(14, 15) +(3, 20) +(13, 21) +(14, 15) +(8, 13) +(14, 15) +(3, 25) +(21, 24) +(13, 24) +(4, 21) +(10, 15) +(8, 16) +(11, 14) +(6, 25) +(14, 20) +(5, 15) +(9, 11) +(12, 15) +(4, 9) +(11, 14) +(5, 16) +(0, 20) +(15, 22) +(8, 11) +(14, 20) +(3, 4) +(0, 23) +(2, 9) +(18, 20) +(4, 10) +(3, 25) +(14, 16) +(0, 24) +(1, 22) +(8, 19) +(2, 21) +(12, 19) +(7, 16) +(10, 17) +(4, 5) +(8, 25) +(9, 24) +(2, 21) +(12, 20) +(3, 4) +(15, 19) +(11, 21) +(4, 6) +(11, 14) +(12, 15) +(4, 25) +(3, 15) +(11, 21) +(5, 6) +(21, 22) +(0, 4) +(11, 14) +(6, 20) +(10, 14) +(1, 6) +(0, 2) +(11, 18) +(4, 23) +(22, 25) +(8, 21) +(3, 6) +(7, 10) +(17, 23) +(2, 15) +(12, 18) +(11, 16) +(9, 21) +(17, 25) +(11, 14) +(5, 23) +(18, 22) +(6, 19) +(4, 19) +(6, 15) +(14, 20) +(16, 23) +(0, 25) +(4, 13) +(5, 14) +(15, 22) +(0, 8) +(18, 19) +(4, 11) +(22, 25) +(12, 19) +(14, 18) +(16, 22) +(6, 25) +(15, 19) +(2, 18) +(19, 21) +(4, 6) +(15, 17) +(4, 12) +(11, 19) +(3, 17) +(14, 21) +(2, 15) +(15, 24) +(3, 9) +(13, 17) +(12, 21) +(2, 19) +(2, 14) +(5, 12) +(13, 18) +(6, 9) +(6, 8) +(13, 24) +(2, 3) +(18, 20) +(9, 24) +(8, 15) +(2, 7) +(6, 24) +(7, 25) +(8, 17) +(9, 11) +(1, 8) +(11, 16) +(14, 17) +(7, 10) +(6, 13) +(10, 11) +(8, 22) +(5, 13) +(17, 23) +(1, 24) +(8, 15) +(13, 16) +(14, 24) +(21, 22) +(17, 21) +(22, 23) +(16, 20) +(10, 15) +(23, 25) +(4, 21) +(13, 17) +(0, 22) +(9, 20) +(11, 16) +(13, 20) +(6, 9) +(3, 23) +(8, 16) +(0, 3) +(2, 9) +(22, 23) +(16, 19) +(1, 19) +(5, 16) +(3, 8) +(2, 6) +(12, 22) +(14, 23) +(8, 14) +(22, 25) +(17, 23) +(15, 16) +(1, 6) +(8, 20) +(0, 15) +(5, 16) +(14, 22) +(3, 25) +(9, 15) +(12, 25) +(14, 21) +(13, 20) +(0, 18) +(7, 15) +(20, 25) +(13, 24) +(17, 21) +(18, 20) +(3, 13) +(9, 21) +(14, 24) +(12, 25) +(10, 25) +(13, 22) +(3, 17) +(1, 24) +(7, 20) +(14, 23) +(12, 16) +(1, 13) +(12, 23) +(2, 3) +(6, 14) +(1, 15) +(2, 19) +(6, 20) +(12, 16) +(23, 24) +(2, 22) +(20, 23) +(16, 25) +(11, 19) +(13, 25) +(7, 16) +(0, 11) +(19, 23) +(14, 22) +(3, 22) +(17, 23) +(7, 24) +(12, 16) +(11, 14) +(5, 7) +(8, 12) +(4, 17) +(12, 23) +(4, 25) +(1, 7) +(8, 9) +(21, 23) +(2, 12) +(9, 19) +(8, 16) +(4, 13) +(15, 19) +(3, 4) +(11, 13) +(2, 5) +(15, 18) +(4, 20) +(13, 22) +(1, 19) +(3, 14) +(0, 5) +(22, 24) +(15, 17) +(14, 16) +(3, 11) +(24, 25) +(13, 14) +(10, 22) +(2, 15) +(12, 17) +(23, 25) +(1, 15) +(11, 14) +(8, 22) +(24, 25) +(0, 11) +(9, 14) +(15, 19) +(8, 16) +(2, 9) +(8, 19) +(1, 11) +(0, 13) +(9, 20) +(1, 4) +(2, 22) +(0, 10) +(0, 15) +(3, 9) +(4, 13) +(19, 20) +(10, 12) +(14, 15) +(5, 13) +(6, 12) +(10, 17) +(0, 21) +(3, 7) +(10, 14) +(6, 9) +(0, 13) +(15, 22) +(2, 3) +(1, 5) +(7, 16) +(3, 11) +(9, 14) +(0, 8) +(1, 12) +(5, 13) +(2, 10) +(4, 7) +(11, 20) +(6, 10) +(12, 22) +(3, 7) +(2, 21) +(5, 24) +(14, 19) +(4, 19) +(10, 13) +(3, 14) +(9, 11) +(18, 21) +(2, 17) +(0, 13) +(19, 20) +(12, 21) +(1, 4) +(2, 15) +(2, 16) +(20, 21) +(5, 19) +(13, 15) +(0, 14) +(12, 25) +(4, 25) +(9, 15) +(2, 6) +(5, 18) +(16, 19) +(3, 16) +(12, 19) +(4, 7) +(6, 10) +(10, 22) +(19, 21) +(16, 24) +(6, 20) +(10, 11) +(23, 24) +(9, 22) +(12, 20) +(2, 24) +(5, 9) +(10, 16) +(6, 22) +(11, 15) +(10, 20) +(8, 15) +(6, 22) +(1, 16) +(15, 22) +(16, 21) +(10, 13) +(8, 23) +(13, 15) +(17, 22) +(8, 25) +(3, 10) +(9, 15) +(23, 25) +(0, 8) +(6, 9) +(4, 8) +(20, 23) +(8, 11) +(2, 4) +(8, 22) +(11, 19) +(4, 25) +(5, 11) +(6, 8) +(2, 4) +(14, 19) +(5, 17) +(4, 21) +(11, 13) +(14, 22) +(18, 21) +(2, 5) +(1, 4) +(14, 23) +(16, 17) +(4, 21) +(2, 24) +(13, 18) +(1, 9) +(3, 17) +(5, 8) +(7, 16) +(17, 24) +(1, 7) +(18, 20) +(3, 22) +(3, 13) +(14, 22) +(24, 25) +(18, 21) +(4, 22) +(14, 15) +(23, 24) +(2, 25) +(18, 19) +(4, 23) +(12, 25) +(6, 24) +(2, 3) +(11, 23) +(10, 24) +(4, 8) +(20, 25) +(9, 25) +(3, 24) +(10, 16) +(6, 23) +(1, 20) +(7, 11) +(2, 8) +(4, 20) +(12, 24) +(11, 18) +(0, 7) +(13, 25) +(3, 15) +(10, 23) +(6, 18) +(2, 23) +(3, 14) +(16, 24) +(0, 5) +(7, 19) +(4, 8) +(1, 18) +(4, 15) +(7, 12) +(8, 13) +(11, 19) +(8, 23) +(7, 17) +(0, 11) +(5, 19) +(2, 15) +(4, 13) +(11, 19) +(13, 15) +(1, 17) +(7, 12) +(0, 6) +(5, 9) +(5, 21) +(13, 15) +(9, 25) +(1, 24) +(10, 19) +(1, 24) +(10, 22) +(3, 25) +(5, 7) +(5, 25) +(1, 20) +(12, 22) +(10, 18) +(12, 24) +(14, 22) +(10, 11) +(20, 21) +(11, 19) +(6, 20) +(4, 21) +(2, 24) +(15, 22) +(1, 10) +(7, 22) +(21, 24) +(12, 20) +(10, 17) +(10, 18) +(16, 20) +(22, 23) +(13, 17) +(12, 14) +(4, 7) +(10, 15) +(18, 21) +(5, 7) +(14, 24) +(0, 16) +(11, 12) +(16, 17) +(12, 20) +(13, 21) +(9, 24) +(6, 10) +(5, 14) +(17, 22) +(12, 15) +(9, 23) +(14, 25) +(10, 16) +(0, 16) +(8, 22) +(3, 23) +(1, 25) +(6, 10) +(3, 19) +(8, 11) +(6, 9) +(6, 19) +(8, 22) +(7, 11) +(5, 22) +(2, 11) +(7, 13) +(12, 19) +(8, 20) +(8, 17) +(7, 15) +(1, 20) +(18, 20) +(9, 15) +(17, 25) +(1, 20) +(24, 25) +(9, 10) +(15, 23) +(10, 17) +(3, 25) +(5, 23) +(9, 16) +(12, 15) +(1, 4) +(3, 7) +(4, 22) +(17, 21) +(13, 25) +(0, 9) +(8, 15) +(9, 10) +(3, 19) +(0, 21) +(13, 22) +(7, 13) +(21, 25) +(12, 22) +(7, 20) +(2, 13) +(5, 12) +(12, 22) +(8, 20) +(2, 18) +(13, 14) +(15, 18) +(1, 2) +(8, 21) +(12, 16) +(13, 22) +(7, 20) +(2, 4) +(22, 24) +(0, 20) +(1, 9) +(16, 23) +(1, 14) +(9, 17) +(15, 22) +(4, 5) +(6, 23) +(5, 7) +(1, 18) +(4, 9) +(11, 17) +(0, 6) +(4, 10) +(7, 18) +(9, 13) +(0, 23) +(5, 14) +(14, 17) +(5, 11) +(6, 7) +(13, 19) +(0, 2) +(10, 14) +(19, 21) +(4, 6) +(0, 8) +(13, 16) +(5, 17) +(6, 9) +(13, 18) +(5, 11) +(2, 16) +(1, 4) +(9, 20) +(6, 13) +(5, 7) +(3, 11) +(4, 10) +(18, 22) +(4, 9) +(6, 21) +(2, 5) +(7, 14) +(1, 20) +(3, 15) +(6, 22) +(7, 13) +(9, 20) +(4, 14) +(12, 15) +(6, 19) +(20, 22) +(7, 18) +(10, 12) +(13, 21) +(10, 15) +(11, 18) +(12, 24) +(7, 20) +(3, 24) +(15, 23) +(18, 25) +(2, 11) +(6, 23) +(12, 15) +(2, 13) +(8, 11) +(4, 24) +(1, 11) +(24, 25) +(12, 23) +(8, 9) +(3, 13) +(2, 5) +(8, 18) +(0, 25) +(9, 15) +(23, 24) +(5, 22) +(2, 12) +(1, 17) +(9, 25) +(0, 11) +(17, 21) +(12, 22) +(7, 18) +(5, 20) +(16, 18) +(13, 20) +(1, 7) +(12, 15) +(0, 14) +(4, 21) +(17, 21) +(4, 8) +(0, 11) +(1, 5) +(2, 21) +(0, 14) +(4, 18) +(17, 19) +(4, 20) +(6, 17) +(18, 25) +(14, 16) +(3, 19) +(13, 16) +(9, 25) +(0, 14) +(15, 18) +(0, 2) +(11, 25) +(13, 21) +(9, 21) +(12, 25) +(0, 24) +(8, 13) +(11, 22) +(10, 25) +(1, 12) +(8, 17) +(16, 22) +(15, 24) +(11, 15) +(8, 21) +(16, 23) +(1, 9) +(10, 19) +(8, 17) +(10, 25) +(18, 19) +(13, 23) +(21, 23) +(14, 17) +(1, 8) +(0, 25) +(10, 16) +(3, 18) +(16, 22) +(14, 24) +(3, 4) +(18, 25) +(3, 7) +(0, 4) +(11, 16) +(17, 25) +(15, 18) +(13, 16) +(0, 25) +(4, 22) +(5, 15) +(3, 23) +(4, 21) +(0, 17) +(2, 13) +(16, 19) +(5, 25) +(6, 17) +(13, 18) +(3, 16) +(0, 25) +(12, 21) +(2, 22) +(0, 10) +(12, 23) +(8, 22) +(15, 21) +(2, 25) +(12, 20) +(9, 10) +(2, 8) +(0, 24) +(4, 21) +(4, 13) +(1, 10) +(17, 24) +(7, 20) +(12, 14) +(9, 19) +(4, 7) +(9, 22) +(10, 11) +(20, 23) +(14, 17) +(23, 24) +(11, 12) +(17, 18) +(6, 14) +(10, 20) +(12, 22) +(2, 10) +(1, 20) +(24, 25) +(4, 23) +(14, 17) +(3, 20) +(0, 4) +(5, 24) +(6, 22) +(12, 25) +(4, 11) +(12, 23) +(6, 14) +(9, 22) +(1, 25) +(0, 16) +(5, 18) +(14, 15) +(1, 5) +(12, 17) +(16, 22) +(6, 7) +(18, 21) +(7, 10) +(18, 20) +(14, 24) +(18, 23) +(4, 10) +(3, 14) +(5, 24) +(1, 20) +(1, 17) +(0, 23) +(3, 16) +(13, 24) +(8, 10) +(3, 22) +(6, 16) +(18, 23) +(7, 8) +(17, 23) +(5, 7) +(8, 24) +(18, 25) +(3, 22) +(21, 23) +(3, 16) +(11, 25) +(4, 25) +(11, 19) +(0, 16) +(2, 25) +(11, 20) +(9, 19) +(20, 22) +(17, 19) +(23, 25) +(11, 18) +(1, 18) +(9, 20) +(4, 19) +(15, 22) +(17, 24) +(11, 16) +(18, 19) +(10, 11) +(1, 14) +(4, 21) +(5, 20) +(6, 15) +(8, 24) +(11, 23) +(0, 14) +(2, 10) +(17, 18) +(0, 10) +(5, 18) +(13, 17) +(11, 21) +(21, 22) +(0, 2) +(15, 18) +(5, 24) +(9, 18) +(24, 25) +(11, 21) +(8, 15) +(10, 22) +(2, 16) +(5, 14) +(15, 24) +(11, 14) +(13, 21) +(7, 9) +(17, 18) +(4, 8) +(6, 8) +(11, 23) +(1, 15) +(9, 20) +(7, 12) +(15, 16) +(9, 24) +(8, 25) +(12, 17) +(19, 20) +(2, 7) +(2, 19) +(1, 7) +(12, 21) +(16, 20) +(3, 9) +(5, 15) +(10, 20) +(9, 11) +(17, 21) +(15, 18) +(0, 7) +(10, 13) +(1, 20) +(9, 17) +(7, 12) +(3, 11) +(6, 21) +(12, 15) +(5, 20) +(10, 25) +(4, 9) +(0, 13) +(12, 18) +(13, 22) +(10, 23) +(1, 5) +(14, 25) +(4, 10) +(8, 13) +(21, 22) +(12, 24) +(3, 14) +(7, 8) +(6, 13) +(4, 9) +(12, 18) +(1, 3) +(8, 11) +(3, 19) +(4, 10) +(12, 24) +(13, 16) +(8, 20) +(9, 10) +(24, 25) +(6, 16) +(18, 19) +(10, 11) +(15, 25) +(9, 23) +(18, 20) +(6, 14) +(12, 16) +(8, 24) +(10, 23) +(13, 18) +(5, 11) +(17, 24) +(6, 21) +(4, 25) +(7, 15) +(7, 8) +(3, 17) +(11, 21) +(18, 23) +(13, 16) +(5, 20) +(4, 15) +(5, 23) +(1, 11) +(8, 24) +(9, 13) +(4, 19) +(15, 18) +(0, 21) +(7, 10) +(11, 24) +(6, 19) +(9, 25) +(5, 10) +(8, 14) +(21, 22) +(0, 22) +(7, 24) +(2, 9) +(3, 14) +(9, 18) +(2, 10) +(4, 22) +(7, 15) +(0, 17) +(4, 13) +(0, 23) +(12, 22) +(16, 18) +(3, 7) +(5, 18) +(6, 16) +(3, 24) +(7, 20) +(0, 17) +(8, 22) +(9, 22) +(0, 23) +(2, 20) +(8, 13) +(6, 17) +(10, 20) +(23, 25) +(0, 11) +(14, 17) +(6, 18) +(19, 23) +(0, 2) +(12, 17) +(1, 18) +(23, 25) +(2, 19) +(3, 18) +(1, 11) +(8, 17) +(1, 5) +(10, 23) +(11, 21) +(6, 17) +(7, 21) +(5, 16) +(1, 9) +(11, 15) +(2, 10) +(4, 7) +(15, 17) +(5, 25) +(11, 14) +(8, 10) +(11, 19) +(7, 9) +(20, 25) +(1, 7) +(0, 9) +(16, 20) +(1, 21) +(7, 20) +(4, 9) +(6, 16) +(7, 15) +(11, 20) +(8, 21) +(1, 6) +(9, 18) +(16, 25) +(8, 13) +(20, 22) +(7, 11) +(0, 6) +(4, 16) +(10, 15) +(16, 17) +(6, 19) +(2, 10) +(9, 22) +(15, 19) +(4, 16) +(15, 19) +(16, 17) +(4, 8) +(3, 8) +(4, 19) +(16, 23) +(6, 15) +(1, 3) +(5, 16) +(23, 24) +(3, 13) +(16, 18) +(12, 23) +(12, 24) +(1, 13) +(12, 17) +(0, 24) +(12, 14) +(0, 9) +(5, 24) +(12, 21) +(5, 20) +(14, 25) +(19, 24) +(20, 23) +(15, 24) +(17, 19) +(12, 16) +(18, 21) +(5, 16) +(4, 12) +(6, 18) +(20, 21) +(5, 21) +(4, 22) +(2, 16) +(1, 2) +(12, 16) +(5, 13) +(19, 21) +(10, 21) +(13, 19) +(5, 14) +(2, 4) +(16, 23) +(3, 16) +(0, 23) +(19, 20) +(13, 19) +(16, 22) +(20, 24) +(3, 6) +(4, 24) +(3, 21) +(7, 22) +(16, 23) +(6, 11) +(0, 13) +(13, 22) +(16, 18) +(3, 7) +(11, 20) +(2, 11) +(14, 22) +(12, 13) +(20, 21) +(3, 12) +(5, 20) +(11, 15) +(13, 14) +(2, 8) +(1, 8) +(3, 20) +(0, 15) +(13, 16) +(2, 19) +(10, 13) +(7, 19) +(6, 15) +(0, 25) +(11, 25) +(9, 15) +(6, 18) +(10, 16) +(4, 25) +(0, 15) +(10, 17) +(2, 16) +(7, 9) +(11, 13) +(16, 23) +(1, 15) +(10, 21) +(9, 12) +(0, 5) +(17, 19) +(13, 21) +(0, 25) +(3, 15) +(2, 19) +(16, 17) +(18, 21) +(19, 23) +(22, 25) +(0, 7) +(1, 15) +(18, 20) +(11, 25) +(17, 23) +(15, 19) +(1, 21) +(4, 19) +(10, 20) +(13, 23) +(1, 14) +(6, 21) +(4, 17) +(14, 25) +(21, 24) +(2, 24) +(5, 17) +(2, 25) +(3, 17) +(18, 24) +(4, 24) +(17, 21) +(0, 18) +(3, 22) +(10, 24) +(4, 11) +(1, 4) +(11, 20) +(0, 10) +(12, 20) +(0, 2) +(9, 11) +(8, 11) +(9, 25) +(6, 20) +(12, 24) +(8, 23) +(6, 13) +(7, 11) +(5, 8) +(7, 14) +(11, 13) +(7, 10) +(11, 17) +(1, 14) +(13, 20) +(1, 19) +(4, 20) +(13, 22) +(6, 13) +(4, 15) +(5, 22) +(15, 18) +(6, 8) +(13, 14) +(1, 4) +(20, 22) +(8, 25) +(7, 20) +(5, 22) +(13, 18) +(8, 10) +(2, 22) +(0, 5) +(13, 24) +(7, 14) +(5, 21) +(2, 7) +(15, 22) +(13, 17) +(5, 24) +(15, 23) +(18, 21) +(1, 2) +(11, 17) +(7, 8) +(5, 13) +(19, 23) +(21, 22) +(14, 15) +(10, 24) +(2, 25) +(12, 18) +(11, 14) +(0, 24) +(17, 21) +(4, 22) +(16, 18) +(6, 10) +(13, 20) +(5, 24) +(8, 17) +(1, 10) +(0, 9) +(13, 19) +(8, 23) +(0, 18) +(7, 9) +(3, 24) +(14, 17) +(8, 19) +(14, 20) +(7, 13) +(16, 17) +(8, 25) +(14, 21) +(16, 22) +(12, 13) +(3, 25) +(16, 21) +(8, 11) +(14, 24) +(2, 22) +(0, 25) +(13, 22) +(11, 19) +(6, 24) +(8, 16) +(8, 22) +(0, 18) +(9, 25) +(6, 15) +(20, 24) +(3, 19) +(12, 19) +(15, 24) +(0, 23) +(17, 23) +(0, 18) +(18, 23) +(1, 23) +(10, 18) +(0, 23) +(4, 18) +(0, 3) +(7, 23) +(5, 18) +(4, 13) +(3, 19) +(0, 1) +(14, 23) +(5, 16) +(13, 24) +(3, 21) +(0, 11) +(16, 18) +(23, 24) +(2, 5) +(6, 11) +(0, 19) +(5, 7) +(12, 16) +(4, 21) +(3, 18) +(2, 3) +(6, 13) +(4, 22) +(1, 7) +(11, 12) +(5, 9) +(0, 1) +(5, 14) +(11, 13) +(9, 20) +(20, 24) +(13, 25) +(7, 9) +(0, 10) +(14, 15) +(14, 16) +(0, 15) +(9, 19) +(21, 25) +(19, 21) +(12, 16) +(9, 17) +(0, 6) +(10, 15) +(6, 25) +(9, 22) +(2, 15) +(0, 24) +(3, 17) +(7, 10) +(12, 14) +(1, 10) +(3, 15) +(8, 9) +(22, 23) +(0, 14) +(11, 24) +(1, 4) +(11, 24) +(0, 14) +(14, 19) +(4, 25) +(18, 24) +(11, 24) +(4, 7) +(6, 19) +(5, 14) +(21, 25) +(14, 16) +(18, 24) +(6, 22) +(2, 5) +(0, 21) +(7, 15) +(17, 19) +(15, 25) +(1, 22) +(0, 16) +(4, 21) +(8, 18) +(13, 14) +(7, 17) +(0, 11) +(9, 16) +(4, 18) +(7, 10) +(3, 8) +(23, 25) +(5, 14) +(9, 18) +(3, 25) +(7, 17) +(8, 10) +(0, 24) +(14, 21) +(10, 23) +(9, 21) +(0, 1) +(3, 5) +(24, 25) +(6, 17) +(4, 24) +(3, 7) +(2, 17) +(21, 25) +(8, 10) +(5, 14) +(7, 23) +(4, 6) +(19, 24) +(12, 21) +(3, 15) +(0, 5) +(15, 24) +(4, 22) +(2, 3) +(5, 14) +(9, 12) +(6, 20) +(11, 23) +(19, 25) +(14, 21) +(3, 13) +(10, 12) +(2, 16) +(1, 4) +(5, 17) +(5, 10) +(21, 22) +(16, 20) +(1, 25) +(3, 8) +(6, 20) +(10, 21) +(5, 25) +(16, 20) +(9, 25) +(13, 25) +(7, 16) +(9, 10) +(4, 20) +(7, 18) +(2, 4) +(13, 24) +(15, 16) +(3, 10) +(4, 10) +(0, 18) +(11, 16) +(7, 14) +(15, 19) +(7, 23) +(8, 18) +(14, 17) +(11, 24) +(0, 3) +(22, 23) +(17, 25) +(6, 7) +(18, 21) +(19, 21) +(6, 15) +(10, 25) +(5, 22) +(7, 12) +(14, 18) +(14, 15) +(0, 5) +(9, 19) +(17, 18) +(16, 25) +(6, 21) +(6, 18) +(0, 7) +(12, 17) +(21, 25) +(14, 22) +(10, 15) +(2, 22) +(12, 13) +(4, 7) +(20, 25) +(10, 17) +(10, 12) +(4, 9) +(3, 13) +(7, 11) +(3, 23) +(11, 13) +(6, 7) +(6, 10) +(22, 23) +(12, 13) +(3, 19) +(5, 7) +(10, 14) +(7, 9) +(6, 24) +(17, 19) +(11, 23) +(5, 21) +(2, 19) +(11, 15) +(6, 25) +(3, 14) +(10, 20) +(19, 23) +(15, 16) +(1, 2) +(4, 6) +(11, 13) +(12, 20) +(6, 25) +(12, 22) +(0, 1) +(2, 18) +(3, 15) +(6, 14) +(1, 18) +(0, 8) +(2, 13) +(15, 17) +(8, 24) +(1, 19) +(13, 23) +(2, 20) +(0, 3) +(5, 6) +(17, 22) +(9, 18) +(4, 15) +(9, 21) +(4, 7) +(13, 22) +(17, 23) +(14, 15) +(5, 8) +(3, 17) +(2, 14) +(17, 23) +(2, 18) +(2, 4) +(3, 17) +(12, 18) +(16, 18) +(3, 21) +(10, 17) +(18, 23) +(10, 14) +(13, 17) +(2, 16) +(0, 2) +(8, 18) +(17, 21) +(10, 15) +(14, 23) +(16, 22) +(21, 25) +(20, 23) +(5, 10) +(2, 11) +(0, 9) +(6, 15) +(6, 7) +(0, 8) +(2, 19) +(3, 20) +(9, 11) +(23, 24) +(19, 25) +(3, 22) +(21, 23) +(1, 11) +(8, 9) +(9, 18) +(5, 25) +(0, 19) +(1, 6) +(0, 8) +(18, 25) +(9, 20) +(8, 16) +(9, 21) +(12, 20) +(0, 4) +(20, 25) +(0, 1) +(15, 16) +(1, 22) +(21, 25) +(20, 23) +(14, 15) +(9, 25) +(13, 14) +(4, 23) +(18, 23) +(17, 25) +(14, 23) +(17, 24) +(2, 18) +(11, 14) +(9, 24) +(16, 23) +(2, 4) +(1, 18) +(1, 7) +(0, 23) +(16, 22) +(16, 25) +(0, 21) +(1, 19) +(7, 23) +(1, 3) +(16, 17) +(0, 18) +(5, 25) +(7, 9) +(4, 19) +(7, 23) +(12, 16) +(19, 20) +(18, 24) +(13, 17) +(1, 15) +(5, 9) +(4, 20) +(13, 25) +(5, 15) +(12, 22) +(18, 21) +(16, 24) +(12, 13) +(3, 25) +(1, 24) +(0, 4) +(14, 22) +(8, 14) +(3, 17) +(6, 24) +(1, 10) +(7, 12) +(4, 18) +(1, 9) +(0, 10) +(21, 24) +(4, 13) +(18, 23) +(6, 11) +(12, 15) +(6, 20) +(18, 22) +(2, 11) +(8, 13) +(0, 21) +(10, 20) +(8, 23) +(11, 21) +(2, 3) +(9, 10) +(3, 24) +(4, 24) +(10, 25) +(9, 17) +(2, 3) +(2, 16) +(17, 24) +(22, 25) +(9, 13) +(3, 7) +(0, 2) +(17, 21) +(9, 16) +(6, 7) +(1, 2) +(10, 21) +(0, 20) +(6, 11) +(0, 8) +(21, 24) +(6, 25) +(1, 8) +(0, 13) +(0, 2) +(11, 13) +(1, 3) +(8, 20) +(3, 21) +(5, 8) +(13, 22) +(7, 20) +(8, 23) +(13, 25) +(5, 20) +(13, 18) +(23, 24) +(5, 22) +(19, 25) +(3, 8) +(10, 22) +(3, 9) +(12, 25) +(6, 18) +(4, 8) +(17, 23) +(8, 11) +(10, 20) +(2, 25) +(21, 23) +(7, 21) +(2, 12) +(4, 8) +(7, 25) +(9, 21) +(8, 17) +(8, 15) +(14, 21) +(17, 24) +(7, 16) +(9, 19) +(11, 16) +(19, 25) +(5, 9) +(3, 17) +(20, 21) +(7, 25) +(11, 18) +(20, 23) +(14, 21) +(2, 9) +(13, 19) +(6, 11) +(15, 21) +(17, 25) +(4, 18) +(16, 23) +(19, 20) +(10, 19) +(12, 17) +(0, 20) +(8, 11) +(3, 16) +(15, 25) +(0, 9) +(14, 19) +(2, 15) +(5, 10) +(17, 22) +(3, 21) +(7, 19) +(10, 23) +(2, 6) +(6, 25) +(7, 24) +(2, 4) +(0, 19) +(18, 23) +(23, 24) +(6, 21) +(0, 15) +(2, 5) +(4, 11) +(9, 19) +(0, 20) +(2, 10) +(19, 25) +(22, 24) +(3, 11) +(8, 9) +(5, 17) +(13, 24) +(17, 23) +(14, 20) +(0, 16) +(3, 4) +(14, 22) +(3, 9) +(0, 7) +(12, 20) +(4, 21) +(2, 7) +(6, 14) +(16, 20) +(0, 15) +(22, 23) +(9, 11) +(6, 8) +(0, 25) +(7, 18) +(3, 11) +(9, 13) +(16, 24) +(15, 20) +(1, 24) +(5, 15) +(11, 20) +(19, 25) +(4, 6) +(14, 19) +(4, 21) +(2, 20) +(11, 18) +(8, 15) +(5, 9) +(17, 21) +(15, 20) +(2, 13) +(4, 12) +(10, 18) +(0, 8) +(0, 11) +(2, 14) +(20, 25) +(3, 15) +(10, 24) +(16, 17) +(13, 23) +(21, 25) +(0, 4) +(5, 23) +(14, 24) +(15, 18) +(12, 20) +(3, 20) +(8, 21) +(13, 24) +(12, 25) +(15, 19) +(8, 10) +(16, 21) +(15, 25) +(3, 19) +(1, 13) +(14, 20) +(10, 20) +(6, 21) +(1, 3) +(7, 19) +(13, 17) +(17, 20) +(9, 21) +(7, 22) +(2, 6) +(6, 24) +(18, 22) +(7, 8) +(2, 11) +(10, 17) +(8, 20) +(17, 24) +(6, 16) +(17, 21) +(16, 23) +(2, 20) +(15, 21) +(10, 23) +(16, 22) +(7, 17) +(6, 20) +(6, 9) +(15, 16) +(13, 20) +(8, 17) +(14, 23) +(7, 25) +(6, 15) +(12, 23) +(10, 14) +(11, 13) +(8, 16) +(19, 25) +(5, 23) +(12, 18) +(4, 15) +(14, 17) +(11, 13) +(7, 10) +(13, 20) +(4, 5) +(6, 23) +(7, 11) +(2, 12) +(1, 18) +(15, 18) +(22, 23) +(4, 13) +(3, 6) +(6, 9) +(8, 23) +(22, 25) +(9, 10) +(7, 23) +(10, 21) +(8, 23) +(7, 23) +(0, 10) +(3, 8) +(0, 13) +(20, 23) +(6, 7) +(3, 11) +(10, 16) +(7, 24) +(10, 15) +(12, 23) +(9, 11) +(6, 21) +(7, 22) +(19, 24) +(6, 16) +(1, 10) +(0, 21) +(8, 10) +(3, 22) +(1, 15) +(18, 21) +(5, 19) +(20, 24) +(20, 23) +(3, 18) +(2, 15) +(9, 10) +(1, 11) +(14, 24) +(0, 22) +(12, 24) +(4, 20) +(23, 25) +(17, 18) +(11, 25) +(4, 16) +(2, 25) +(13, 16) +(9, 16) +(6, 13) +(2, 20) +(6, 18) +(9, 12) +(4, 16) +(13, 17) +(0, 18) +(7, 16) +(5, 12) +(9, 16) +(5, 23) +(0, 6) +(8, 12) +(0, 11) +(12, 17) +(8, 12) +(17, 23) +(2, 8) +(5, 12) +(20, 23) +(8, 24) +(4, 5) +(12, 17) +(20, 25) +(17, 18) +(12, 22) +(8, 21) +(1, 20) +(12, 20) +(11, 17) +(1, 7) +(2, 18) +(16, 22) +(5, 8) +(13, 18) +(1, 21) +(22, 23) +(7, 17) +(8, 10) +(18, 25) +(13, 14) +(6, 21) +(9, 22) +(13, 24) +(11, 18) +(4, 14) +(9, 25) +(0, 24) +(11, 15) +(14, 23) +(9, 16) +(12, 13) +(4, 14) +(11, 12) +(7, 16) +(15, 18) +(16, 24) +(4, 15) +(5, 11) +(14, 23) +(12, 13) +(14, 23) +(15, 18) +(0, 12) +(5, 10) +(4, 11) +(16, 17) +(7, 11) +(5, 25) +(2, 14) +(16, 24) +(19, 23) +(0, 10) +(4, 7) +(13, 14) +(0, 1) +(3, 23) +(19, 25) +(1, 21) +(18, 19) +(14, 22) +(0, 1) +(2, 14) +(12, 22) +(13, 14) +(2, 24) +(1, 21) +(17, 22) +(9, 24) +(4, 17) +(2, 10) +(8, 22) +(3, 14) +(10, 20) +(19, 22) +(2, 7) +(16, 24) +(13, 14) +(4, 23) +(4, 8) +(10, 14) +(5, 19) +(12, 13) +(15, 22) +(6, 7) +(6, 23) +(0, 12) +(19, 20) +(8, 11) +(15, 18) +(3, 5) +(11, 24) +(5, 20) +(8, 23) +(1, 3) +(6, 10) +(3, 22) +(1, 2) +(7, 8) +(0, 20) +(10, 21) +(3, 14) +(15, 20) +(18, 22) +(1, 5) +(2, 23) +(12, 18) +(1, 13) +(11, 20) +(5, 15) +(11, 17) +(0, 13) +(5, 16) +(4, 15) +(10, 17) +(16, 24) +(11, 20) +(5, 15) +(10, 14) +(8, 17) +(11, 25) +(5, 22) +(3, 11) +(17, 25) +(2, 3) +(11, 21) +(4, 17) +(11, 19) +(13, 21) +(3, 9) +(2, 10) +(1, 11) +(18, 19) +(7, 21) +(8, 19) +(18, 19) +(12, 19) +(13, 19) +(12, 24) +(19, 25) +(13, 16) +(20, 24) +(3, 12) +(16, 18) +(15, 25) +(17, 24) +(15, 19) +(12, 18) +(22, 25) +(11, 15) +(2, 25) +(0, 12) +(19, 23) +(4, 18) +(18, 22) +(4, 10) +(6, 15) +(0, 23) +(9, 12) +(11, 17) +(2, 19) +(1, 15) +(6, 7) +(9, 14) +(8, 18) +(12, 18) +(3, 15) +(0, 1) +(6, 20) +(3, 11) +(1, 10) +(6, 24) +(15, 22) +(6, 16) +(1, 19) +(4, 15) +(24, 25) +(15, 22) +(5, 24) +(5, 7) +(2, 24) +(4, 5) +(17, 24) +(2, 10) +(7, 8) +(1, 24) +(4, 17) +(8, 23) +(7, 14) +(9, 24) +(4, 5) +(7, 14) +(11, 17) +(7, 15) +(14, 23) +(9, 13) +(0, 11) +(15, 22) +(3, 9) +(0, 18) +(8, 11) +(13, 21) +(6, 14) +(9, 12) +(10, 14) +(3, 22) +(7, 15) +(3, 7) +(17, 22) +(1, 12) +(5, 12) +(2, 17) +(3, 4) +(15, 22) +(1, 5) +(19, 22) +(10, 15) +(7, 12) +(10, 17) +(15, 24) +(12, 14) +(1, 6) +(9, 17) +(1, 16) +(15, 21) +(8, 10) +(9, 13) +(17, 21) +(1, 19) +(8, 12) +(19, 23) +(9, 24) +(8, 25) +(13, 15) +(3, 17) +(4, 17) +(0, 23) +(8, 20) +(16, 24) +(2, 9) +(3, 11) +(4, 21) +(10, 24) +(9, 18) +(13, 20) +(0, 12) +(6, 23) +(16, 24) +(0, 15) +(11, 23) +(6, 17) +(5, 6) +(14, 16) +(9, 23) +(4, 11) +(2, 24) +(8, 16) +(2, 19) +(3, 23) +(1, 14) +(10, 24) +(6, 12) +(6, 23) +(2, 22) +(1, 4) +(14, 16) +(5, 19) +(15, 19) +(4, 24) +(2, 11) +(21, 24) +(2, 25) +(9, 19) +(7, 11) +(5, 15) +(5, 6) +(7, 18) +(2, 20) +(14, 18) +(8, 20) +(12, 14) +(20, 22) +(8, 15) +(8, 18) +(13, 15) +(14, 23) +(10, 20) +(8, 13) +(20, 25) +(10, 17) +(8, 12) +(11, 17) +(10, 24) +(13, 14) +(7, 11) +(23, 24) +(10, 21) +(3, 17) +(3, 5) +(6, 24) +(1, 10) +(11, 22) +(18, 21) +(4, 17) +(8, 17) +(10, 16) +(5, 18) +(19, 22) +(6, 9) +(0, 10) +(14, 22) +(12, 18) +(2, 8) +(9, 15) +(4, 15) +(14, 21) +(0, 11) +(20, 22) +(3, 9) +(10, 13) +(17, 22) +(5, 9) +(11, 13) +(12, 20) +(3, 16) +(15, 25) +(1, 4) +(12, 18) +(11, 14) +(4, 7) +(16, 21) +(1, 23) +(1, 22) +(6, 16) +(11, 13) +(7, 19) +(2, 23) +(3, 18) +(12, 20) +(12, 15) +(1, 17) +(5, 22) +(3, 20) +(9, 18) +(0, 7) +(7, 10) +(1, 23) +(3, 19) +(0, 15) +(9, 14) +(4, 7) +(19, 23) +(3, 6) +(4, 24) +(20, 23) +(2, 7) +(2, 11) +(21, 24) +(7, 22) +(16, 23) +(17, 21) +(8, 24) +(11, 18) +(13, 18) +(7, 21) +(14, 17) +(0, 21) +(10, 17) +(6, 18) +(14, 19) +(5, 6) +(13, 18) +(21, 23) +(10, 24) +(7, 17) +(3, 10) +(18, 22) +(5, 9) +(1, 5) +(0, 10) +(9, 12) +(14, 22) +(9, 18) +(1, 22) +(12, 15) +(12, 13) +(2, 18) +(14, 15) +(9, 20) +(12, 16) +(1, 2) +(18, 24) +(8, 20) +(4, 9) +(14, 22) +(13, 25) +(9, 13) +(14, 21) +(6, 22) +(16, 17) +(5, 8) +(7, 12) +(0, 5) +(7, 15) +(22, 25) +(6, 12) +(17, 18) +(14, 20) +(14, 22) +(5, 8) +(6, 13) +(4, 12) +(0, 9) +(9, 10) +(5, 21) +(1, 13) +(0, 23) +(3, 22) +(8, 17) +(20, 23) +(5, 12) +(3, 7) +(11, 21) +(12, 25) +(3, 16) +(0, 5) +(11, 24) +(18, 21) +(5, 24) +(11, 25) +(18, 22) +(17, 21) +(8, 12) +(7, 25) +(16, 21) +(18, 19) +(4, 12) +(11, 15) +(8, 20) +(7, 11) +(8, 20) +(13, 18) +(12, 15) +(1, 21) +(4, 6) +(8, 12) +(19, 20) +(20, 22) +(6, 12) +(8, 24) +(19, 20) +(11, 22) +(3, 24) +(15, 24) +(17, 24) +(15, 16) +(23, 24) +(8, 16) +(3, 17) +(1, 15) +(5, 16) +(1, 7) +(2, 17) +(3, 22) +(8, 15) +(10, 16) +(0, 5) +(0, 4) +(8, 16) +(5, 25) +(5, 15) +(1, 8) +(13, 25) +(14, 16) +(13, 17) +(4, 14) +(0, 16) +(18, 25) +(1, 7) +(1, 2) +(0, 25) +(14, 18) +(15, 16) +(17, 22) +(5, 25) +(14, 18) +(2, 10) +(11, 18) +(10, 25) +(2, 19) +(19, 22) +(3, 18) +(2, 13) +(18, 19) +(3, 21) +(11, 21) +(3, 9) +(11, 15) +(20, 21) +(9, 23) +(9, 22) +(10, 11) +(5, 15) +(18, 21) +(0, 20) +(3, 9) +(4, 10) +(22, 24) +(5, 17) +(16, 24) +(2, 3) +(5, 15) +(12, 22) +(13, 22) +(3, 12) +(15, 18) +(2, 7) +(16, 17) +(13, 16) +(1, 15) +(6, 17) +(22, 24) +(18, 19) +(4, 18) +(13, 19) +(1, 7) +(10, 17) +(6, 10) +(3, 17) +(4, 15) +(8, 15) +(10, 20) +(4, 9) +(6, 8) +(9, 11) +(3, 4) +(8, 20) +(11, 12) +(3, 7) +(0, 4) +(4, 5) +(12, 25) +(7, 14) +(8, 9) +(0, 21) +(11, 25) +(1, 9) +(10, 14) +(6, 21) +(4, 12) +(2, 8) +(0, 16) +(7, 18) +(12, 18) +(10, 19) +(6, 16) +(11, 13) +(5, 7) +(14, 15) +(16, 23) +(7, 9) +(6, 19) +(3, 11) +(13, 20) +(6, 14) +(13, 23) +(16, 17) +(4, 14) +(3, 13) +(5, 6) +(2, 17) +(16, 22) +(10, 23) +(1, 13) +(8, 16) +(2, 18) +(16, 21) +(8, 12) +(1, 11) +(7, 13) +(5, 21) +(11, 17) +(3, 13) +(1, 20) +(0, 8) +(16, 22) +(12, 24) +(0, 23) +(10, 12) +(3, 25) +(18, 24) +(1, 22) +(14, 24) +(9, 12) +(6, 23) +(10, 15) +(5, 22) +(11, 15) +(7, 14) +(0, 24) +(2, 23) +(12, 13) +(13, 24) +(5, 15) +(7, 19) +(1, 11) +(14, 18) +(22, 23) +(7, 16) +(15, 21) +(5, 14) +(8, 18) +(10, 24) +(15, 23) +(16, 17) +(3, 8) +(10, 25) +(22, 24) +(0, 14) +(1, 18) +(6, 16) +(5, 8) +(15, 18) +(1, 13) +(17, 20) +(8, 23) +(14, 16) +(5, 19) +(6, 7) +(13, 24) +(0, 17) +(14, 21) +(4, 23) +(3, 19) +(0, 17) +(7, 22) +(12, 21) +(0, 16) +(17, 18) +(6, 22) +(9, 23) +(4, 14) +(18, 19) +(0, 8) +(5, 16) +(2, 4) +(1, 23) +(14, 24) +(9, 22) +(13, 24) +(0, 2) +(10, 16) +(9, 17) +(4, 11) +(5, 12) +(14, 24) +(7, 12) +(4, 22) +(16, 18) +(1, 5) +(8, 13) +(1, 14) +(9, 18) +(0, 8) +(5, 24) +(9, 16) +(3, 8) +(1, 7) +(5, 21) +(6, 21) +(3, 20) +(5, 23) +(14, 21) +(6, 7) +(13, 23) +(5, 25) +(5, 15) +(2, 14) +(11, 25) +(10, 21) +(7, 8) +(0, 15) +(14, 24) +(1, 2) +(5, 19) +(7, 8) +(6, 25) +(4, 19) +(2, 18) +(1, 11) +(15, 23) +(5, 22) +(9, 14) +(2, 14) +(19, 25) +(4, 12) +(10, 15) +(5, 7) +(1, 12) +(0, 25) +(5, 18) +(15, 22) +(4, 20) +(7, 8) +(2, 11) +(15, 25) +(1, 13) +(5, 24) +(8, 21) +(11, 13) +(1, 23) +(17, 21) +(8, 9) +(11, 16) +(6, 23) +(2, 17) +(1, 21) +(9, 10) +(13, 24) +(3, 6) +(4, 9) +(8, 23) +(14, 21) +(3, 24) +(8, 19) +(4, 12) +(10, 14) +(9, 22) +(6, 23) +(11, 19) +(3, 21) +(8, 25) +(7, 22) +(11, 23) +(6, 8) +(7, 19) +(3, 24) +(8, 17) +(3, 21) +(0, 11) +(6, 19) +(3, 24) +(9, 21) +(3, 5) +(13, 24) +(20, 21) +(5, 13) +(15, 24) +(20, 22) +(1, 5) +(13, 18) +(2, 24) +(9, 22) +(4, 22) +(5, 20) +(3, 9) +(5, 23) +(4, 11) +(3, 25) +(0, 25) +(3, 15) +(4, 9) +(7, 25) +(9, 10) +(0, 8) +(21, 25) +(1, 9) +(1, 4) +(3, 9) +(8, 25) +(12, 21) +(1, 5) +(19, 25) +(20, 21) +(4, 17) +(8, 15) +(15, 25) +(14, 21) +(10, 20) +(10, 16) +(9, 21) +(2, 20) +(3, 20) +(2, 7) +(2, 13) +(7, 22) +(3, 12) +(14, 22) +(12, 18) +(0, 3) +(0, 5) +(3, 13) +(2, 22) +(12, 20) +(2, 21) +(13, 14) +(7, 12) +(17, 20) +(15, 20) +(10, 17) +(7, 16) +(1, 14) +(12, 25) +(1, 7) +(2, 16) +(3, 10) +(8, 15) +(9, 20) +(7, 21) +(4, 10) +(6, 8) +(9, 19) +(15, 23) +(3, 11) +(17, 23) +(3, 25) +(9, 24) +(8, 13) +(13, 21) +(12, 17) +(0, 25) +(5, 24) +(3, 11) +(6, 23) +(4, 24) +(12, 20) +(1, 5) +(16, 25) +(10, 17) +(2, 10) +(8, 16) +(4, 9) +(19, 24) +(20, 22) +(0, 12) +(17, 24) +(7, 9) +(6, 8) +(2, 15) +(18, 20) +(5, 19) +(11, 18) +(15, 23) +(7, 14) +(9, 21) +(2, 4) +(5, 25) +(17, 19) +(10, 19) +(1, 25) +(5, 16) +(11, 20) +(5, 13) +(10, 17) +(18, 25) +(13, 14) +(5, 23) +(17, 22) +(21, 22) +(3, 5) +(7, 23) +(14, 19) +(15, 23) +(8, 19) +(7, 12) +(4, 15) +(8, 24) +(12, 14) +(9, 19) +(15, 17) +(19, 25) +(2, 14) +(12, 21) +(18, 24) +(5, 24) +(12, 18) +(2, 16) +(10, 21) +(6, 25) +(4, 14) +(9, 21) +(0, 4) +(10, 17) +(2, 15) +(22, 25) +(2, 23) +(4, 7) +(8, 25) +(1, 15) +(0, 18) +(9, 19) +(7, 13) +(9, 16) +(0, 21) +(1, 11) +(7, 8) +(11, 25) +(13, 21) +(8, 20) +(0, 21) +(6, 7) +(13, 21) +(4, 20) +(8, 24) +(6, 23) +(1, 13) +(9, 20) +(21, 25) +(4, 19) +(3, 24) +(9, 16) +(1, 7) +(13, 19) +(15, 24) +(11, 21) +(3, 12) +(5, 25) +(1, 17) +(19, 20) +(15, 25) +(3, 16) +(0, 9) +(6, 13) +(13, 15) +(7, 9) +(19, 23) +(8, 17) +(1, 24) +(2, 19) +(8, 16) +(7, 12) +(1, 16) +(7, 9) +(8, 10) +(16, 23) +(7, 12) +(7, 20) +(12, 21) +(4, 20) +(9, 12) +(13, 21) +(12, 22) +(4, 21) +(9, 13) +(9, 17) +(12, 14) +(6, 22) +(4, 16) +(22, 24) +(14, 21) +(5, 17) +(2, 12) +(6, 19) +(7, 24) +(11, 14) +(0, 12) +(6, 13) +(21, 22) +(4, 6) +(13, 25) +(20, 22) +(17, 24) +(0, 21) +(19, 22) +(3, 24) +(0, 2) +(6, 22) +(0, 18) +(2, 5) +(8, 19) +(5, 15) +(11, 18) +(1, 11) +(0, 5) +(2, 15) +(7, 11) +(1, 25) +(5, 18) +(7, 9) +(18, 21) +(1, 3) +(3, 25) +(7, 15) +(19, 21) +(9, 11) +(11, 14) +(9, 18) +(2, 25) +(5, 25) +(9, 14) +(2, 6) +(9, 15) +(2, 22) +(24, 25) +(12, 24) +(21, 25) +(6, 22) +(8, 24) +(9, 12) +(13, 21) +(2, 25) +(11, 22) +(11, 16) +(5, 25) +(13, 17) +(8, 10) +(2, 9) +(1, 21) +(23, 24) +(12, 20) +(13, 15) +(9, 14) +(17, 25) +(19, 24) +(1, 7) +(11, 24) +(1, 15) +(0, 19) +(17, 22) +(1, 11) +(22, 25) +(7, 19) +(0, 3) +(13, 25) +(4, 19) +(7, 15) +(5, 11) +(0, 23) +(5, 8) +(3, 11) +(2, 19) +(4, 16) +(7, 18) +(3, 9) +(4, 25) +(0, 11) +(19, 23) +(10, 23) +(4, 13) +(19, 20) +(11, 16) +(9, 15) +(2, 25) +(14, 20) +(21, 23) +(6, 16) +(10, 12) +(10, 16) +(14, 23) +(6, 22) +(17, 20) +(16, 24) +(11, 22) +(7, 23) +(14, 18) +(6, 15) +(1, 10) +(4, 11) +(16, 22) +(0, 1) +(10, 14) +(6, 19) +(15, 16) +(19, 25) +(1, 5) +(12, 22) +(2, 10) +(7, 12) +(6, 15) +(3, 25) +(10, 21) +(22, 25) +(10, 20) +(2, 21) +(2, 23) +(17, 21) +(10, 18) +(8, 25) +(3, 22) +(0, 25) +(9, 22) +(2, 12) +(8, 24) +(0, 14) +(5, 8) +(2, 11) +(9, 21) +(4, 24) +(2, 3) +(7, 24) +(1, 14) +(0, 19) +(4, 24) +(2, 14) +(3, 19) +(7, 16) +(13, 24) +(7, 10) +(4, 22) +(22, 23) +(13, 21) +(4, 9) +(10, 11) +(13, 19) +(20, 22) +(2, 11) +(5, 23) +(6, 10) +(11, 16) +(13, 25) +(2, 18) +(10, 24) +(5, 17) +(21, 22) +(14, 16) +(5, 19) +(6, 11) +(9, 21) +(5, 23) +(6, 15) +(12, 21) +(14, 17) +(19, 25) +(8, 16) +(14, 23) +(7, 8) +(5, 16) +(2, 15) +(3, 17) +(0, 3) +(1, 8) +(17, 19) +(7, 25) +(19, 24) +(7, 22) +(1, 15) +(16, 24) +(7, 20) +(8, 15) +(5, 19) +(8, 13) +(7, 23) +(10, 24) +(20, 22) +(8, 25) +(2, 20) +(7, 18) +(7, 23) +(1, 18) +(1, 10) +(4, 7) +(22, 23) +(11, 23) +(7, 18) +(4, 25) +(8, 22) +(9, 18) +(8, 10) +(21, 22) +(5, 7) +(6, 11) +(3, 7) +(11, 15) +(6, 13) +(13, 24) +(11, 14) +(4, 15) +(7, 20) +(6, 16) +(0, 14) +(6, 23) +(10, 16) +(2, 24) +(6, 8) +(0, 17) +(14, 25) +(11, 25) +(0, 20) +(14, 15) +(19, 20) +(3, 25) +(11, 21) +(12, 14) +(14, 23) +(3, 12) +(19, 24) +(0, 25) +(2, 12) +(3, 22) +(7, 12) +(3, 24) +(1, 22) +(1, 17) +(0, 22) +(7, 20) +(8, 24) +(12, 22) +(11, 20) +(8, 18) +(7, 10) +(0, 13) +(21, 22) +(16, 18) +(11, 24) +(0, 20) +(10, 19) +(2, 13) +(10, 15) +(12, 19) +(4, 22) +(21, 23) +(9, 20) +(1, 13) +(3, 16) +(6, 10) +(17, 20) +(16, 23) +(1, 24) +(11, 15) +(3, 19) +(22, 25) +(5, 17) +(21, 25) +(1, 11) +(7, 22) +(8, 24) +(2, 24) +(6, 22) +(9, 21) +(7, 8) +(2, 18) +(0, 22) +(15, 21) +(7, 25) +(2, 20) +(0, 19) +(22, 23) +(11, 15) +(18, 19) +(2, 10) +(3, 20) +(16, 23) +(17, 22) +(3, 25) +(6, 16) +(2, 7) +(9, 10) +(4, 25) +(6, 23) +(7, 8) +(9, 15) +(1, 16) +(5, 8) +(9, 17) +(3, 7) +(14, 23) +(13, 25) +(6, 21) +(9, 14) +(0, 6) +(5, 12) +(8, 10) +(4, 13) +(14, 24) +(8, 16) +(4, 25) +(10, 17) +(13, 20) +(3, 4) +(20, 22) +(17, 21) +(8, 16) +(9, 24) +(3, 7) +(12, 24) +(4, 21) +(9, 18) +(14, 21) +(10, 12) +(4, 23) +(12, 19) +(7, 21) +(2, 23) +(4, 17) +(1, 14) +(7, 20) +(9, 17) +(16, 19) +(2, 14) +(1, 24) +(14, 25) +(15, 24) +(4, 19) +(1, 23) +(16, 20) +(17, 23) +(19, 20) +(8, 24) +(12, 15) +(1, 3) +(2, 15) +(0, 1) +(6, 8) +(3, 11) +(19, 24) +(7, 23) +(12, 13) +(6, 18) +(8, 20) +(22, 24) +(4, 13) +(1, 13) +(21, 24) +(2, 20) +(8, 15) +(3, 18) +(12, 22) +(2, 10) +(1, 8) +(6, 22) +(0, 3) +(16, 20) +(7, 15) +(1, 7) +(18, 22) +(5, 10) +(6, 12) +(3, 13) +(9, 20) +(10, 15) +(8, 22) +(2, 12) +(6, 16) +(13, 21) +(9, 22) +(0, 12) +(4, 13) +(8, 18) +(2, 5) +(6, 22) +(0, 7) +(6, 25) +(2, 22) +(4, 7) +(0, 11) +(2, 16) +(12, 22) +(11, 14) +(0, 4) +(5, 12) +(2, 17) +(20, 22) +(8, 12) +(5, 18) +(2, 15) +(8, 24) +(16, 18) +(12, 23) +(10, 12) +(9, 23) +(8, 25) +(6, 18) +(20, 23) +(10, 14) +(4, 8) +(9, 18) +(2, 8) +(3, 23) +(16, 20) +(1, 9) +(0, 10) +(5, 14) +(18, 25) +(6, 8) +(18, 24) +(22, 25) +(1, 13) +(6, 22) +(2, 8) +(21, 24) +(1, 14) +(9, 21) +(6, 19) +(1, 23) +(8, 25) +(17, 22) +(2, 3) +(5, 24) +(8, 20) +(3, 24) +(6, 18) +(2, 4) +(12, 21) +(6, 17) +(2, 18) +(9, 21) +(4, 13) +(21, 23) +(5, 17) +(2, 16) +(18, 25) +(7, 9) +(6, 11) +(11, 23) +(0, 2) +(8, 21) +(1, 17) +(15, 25) +(11, 20) +(6, 17) +(20, 22) +(6, 14) +(13, 17) +(20, 21) +(12, 17) +(2, 20) +(10, 17) +(12, 22) +(2, 16) +(0, 22) +(11, 17) +(1, 22) +(17, 23) +(0, 5) +(11, 13) +(13, 24) +(21, 23) +(5, 22) +(1, 8) +(11, 19) +(11, 25) +(3, 19) +(2, 23) +(14, 24) +(3, 17) +(6, 11) +(12, 24) +(18, 25) +(18, 23) +(8, 25) +(6, 12) +(3, 15) +(17, 21) +(10, 12) +(13, 25) +(6, 8) +(12, 25) +(8, 22) +(6, 14) +(13, 20) +(7, 10) +(5, 12) +(8, 25) +(0, 7) +(2, 14) +(10, 22) +(9, 13) +(2, 15) +(4, 13) +(12, 16) +(9, 17) +(3, 5) +(1, 12) +(0, 4) +(15, 23) +(11, 16) +(9, 25) +(13, 21) +(16, 18) +(19, 21) +(2, 9) +(14, 25) +(1, 12) +(1, 13) +(12, 19) +(11, 21) +(7, 12) +(1, 4) +(8, 13) +(16, 21) +(11, 14) +(8, 20) +(1, 19) +(16, 18) +(13, 24) +(4, 8) +(15, 20) +(1, 21) +(12, 13) +(9, 24) +(9, 15) +(2, 13) +(16, 24) +(4, 7) +(6, 8) +(6, 12) +(2, 18) +(7, 14) +(2, 6) +(13, 18) +(12, 17) +(7, 20) +(14, 19) +(10, 14) +(6, 20) +(13, 21) +(2, 8) +(9, 12) +(17, 22) +(4, 18) +(19, 24) +(7, 14) +(5, 6) +(18, 23) +(19, 20) +(1, 8) +(12, 17) +(22, 23) +(0, 5) +(1, 16) +(9, 17) +(8, 21) +(2, 18) +(7, 19) +(8, 25) +(2, 10) +(16, 24) +(7, 14) +(13, 22) +(2, 15) +(10, 18) +(16, 20) +(23, 24) +(10, 25) +(5, 15) +(1, 16) +(20, 23) +(1, 8) +(24, 25) +(5, 6) +(20, 21) +(22, 24) +(4, 21) +(2, 6) +(1, 25) +(8, 10) +(16, 22) +(2, 18) +(1, 15) +(10, 20) +(21, 24) +(6, 14) +(1, 23) +(15, 21) +(7, 16) +(17, 20) +(0, 10) +(10, 24) +(11, 20) +(23, 25) +(13, 17) +(0, 9) +(9, 25) +(8, 24) +(19, 23) +(13, 18) +(0, 14) +(1, 11) +(1, 17) +(13, 23) +(9, 11) +(14, 16) +(6, 18) +(10, 24) +(8, 24) +(11, 15) +(6, 19) +(5, 23) +(1, 22) +(9, 16) +(4, 17) +(22, 24) +(8, 25) +(4, 14) +(17, 21) +(0, 9) +(8, 19) +(13, 25) +(2, 4) +(0, 3) +(17, 23) +(13, 16) +(4, 23) +(15, 16) +(9, 13) +(3, 4) +(4, 23) +(12, 15) +(13, 18) +(8, 13) +(7, 15) +(3, 4) +(17, 18) +(5, 23) +(12, 24) +(12, 15) +(3, 14) +(20, 24) +(10, 14) +(9, 15) +(13, 24) +(3, 7) +(12, 25) +(5, 20) +(0, 3) +(12, 23) +(5, 21) +(4, 20) +(11, 24) +(8, 15) +(7, 18) +(6, 21) +(16, 18) +(5, 25) +(7, 24) +(4, 17) +(2, 6) +(21, 24) +(7, 11) +(19, 25) +(12, 21) +(2, 25) +(19, 23) +(3, 25) +(8, 21) +(13, 19) +(15, 23) +(8, 16) +(2, 19) +(9, 13) +(4, 23) +(2, 4) +(6, 13) +(17, 19) +(2, 25) +(3, 13) +(4, 23) +(17, 20) +(6, 24) +(19, 25) +(15, 20) +(18, 23) +(3, 5) +(9, 13) +(2, 10) +(12, 23) +(13, 21) +(0, 9) +(5, 24) +(18, 22) +(10, 20) +(4, 24) +(12, 15) +(19, 21) +(0, 14) +(7, 9) +(10, 16) +(0, 16) +(15, 25) +(8, 12) +(1, 14) +(20, 21) +(4, 22) +(7, 23) +(8, 11) +(14, 15) +(18, 25) +(19, 21) +(15, 19) +(8, 14) +(9, 11) +(5, 15) +(14, 18) +(2, 9) +(17, 19) +(11, 23) +(0, 15) +(11, 21) +(5, 18) +(9, 16) +(1, 2) +(7, 14) +(1, 23) +(18, 19) +(3, 21) +(4, 15) +(2, 14) +(7, 12) +(11, 13) +(1, 11) +(13, 20) +(2, 4) +(3, 7) +(21, 22) +(6, 22) +(3, 10) +(0, 21) +(16, 20) +(4, 25) +(6, 11) +(2, 21) +(24, 25) +(9, 10) +(12, 22) +(0, 14) +(16, 21) +(0, 17) +(22, 23) +(12, 13) +(8, 10) +(10, 14) +(9, 21) +(3, 23) +(15, 17) +(12, 20) +(0, 8) +(8, 10) +(1, 3) +(4, 15) +(19, 20) +(11, 21) +(4, 14) +(3, 19) +(6, 20) +(2, 19) +(4, 24) +(3, 12) +(14, 25) +(20, 23) +(7, 14) +(8, 12) +(20, 23) +(10, 23) +(10, 22) +(16, 23) +(15, 22) +(17, 23) +(4, 10) +(5, 17) +(10, 24) +(1, 23) +(6, 15) +(4, 20) +(11, 22) +(8, 17) +(3, 24) +(18, 22) +(10, 19) +(5, 21) +(18, 19) +(8, 13) +(5, 12) +(3, 21) +(7, 22) +(6, 12) +(5, 23) +(1, 3) +(2, 13) +(5, 23) +(1, 11) +(13, 20) +(3, 7) +(4, 6) +(5, 21) +(6, 13) +(4, 17) +(1, 20) +(11, 25) +(5, 24) +(16, 17) +(13, 15) +(9, 16) +(10, 13) +(5, 12) +(16, 20) +(6, 9) +(10, 18) +(12, 22) +(2, 5) +(0, 9) +(8, 12) +(22, 25) +(2, 7) +(16, 23) +(5, 21) +(13, 23) +(12, 17) +(16, 24) +(11, 22) +(7, 8) +(19, 25) +(11, 18) +(17, 21) +(14, 19) +(16, 18) +(9, 17) +(21, 25) +(19, 21) +(9, 13) +(12, 25) +(0, 17) +(12, 15) +(0, 3) +(14, 21) +(10, 13) +(1, 25) +(8, 9) +(3, 8) +(0, 23) +(9, 11) +(2, 14) +(6, 12) +(13, 17) +(5, 21) +(4, 23) +(11, 22) +(6, 25) +(6, 9) +(19, 22) +(21, 25) +(1, 4) +(18, 19) +(12, 22) +(1, 2) +(4, 7) +(1, 14) +(7, 13) +(22, 24) +(11, 13) +(1, 2) +(12, 14) +(7, 25) +(14, 19) +(2, 10) +(1, 9) +(7, 20) +(13, 25) +(11, 16) +(8, 16) +(13, 21) +(2, 23) +(17, 19) +(18, 20) +(4, 8) +(3, 23) +(17, 24) +(1, 20) +(18, 19) +(12, 13) +(10, 23) +(18, 19) +(3, 15) +(21, 24) +(7, 13) +(12, 14) +(5, 17) +(17, 22) +(9, 21) +(6, 14) +(6, 8) +(21, 22) +(5, 21) +(6, 15) +(8, 25) +(8, 12) +(14, 25) +(1, 6) +(23, 25) +(12, 21) +(1, 7) +(8, 15) +(8, 13) +(0, 7) +(9, 25) +(6, 15) +(1, 11) +(6, 8) +(9, 18) +(11, 23) +(24, 25) +(10, 13) +(7, 21) +(4, 9) +(6, 17) +(7, 12) +(14, 18) +(23, 25) +(13, 22) +(8, 19) +(0, 10) +(20, 22) +(14, 23) +(10, 19) +(2, 4) +(7, 25) +(8, 18) +(17, 23) +(14, 24) +(2, 19) +(15, 25) +(4, 14) +(2, 19) +(16, 17) +(23, 24) +(3, 24) +(10, 14) +(17, 20) +(4, 21) +(9, 16) +(10, 23) +(19, 20) +(3, 6) +(1, 16) +(4, 11) +(17, 21) +(1, 7) +(0, 17) +(9, 23) +(2, 10) +(10, 16) +(2, 14) +(9, 25) +(12, 23) +(10, 20) +(3, 12) +(2, 24) +(8, 16) +(14, 21) +(13, 23) +(1, 24) +(0, 21) +(8, 12) +(11, 13) +(2, 5) +(13, 15) +(1, 22) +(9, 11) +(12, 20) +(5, 25) +(2, 18) +(9, 13) +(14, 20) +(11, 24) +(15, 17) +(1, 3) +(23, 25) +(8, 23) +(1, 10) +(0, 20) +(17, 21) +(11, 19) +(14, 18) +(4, 25) +(2, 14) +(8, 16) +(11, 12) +(4, 10) +(1, 9) +(17, 25) +(4, 6) +(2, 19) +(14, 24) +(7, 8) +(3, 19) +(6, 22) +(2, 8) +(2, 12) +(3, 4) +(5, 6) +(8, 9) +(4, 13) +(3, 9) +(7, 8) +(5, 14) +(8, 15) +(0, 5) +(7, 11) +(3, 17) +(1, 14) +(13, 22) +(10, 13) +(14, 24) +(7, 12) +(1, 21) +(19, 22) +(1, 6) +(2, 13) +(3, 24) +(12, 15) +(18, 21) +(6, 14) +(1, 18) +(2, 3) +(0, 21) +(2, 4) +(1, 6) +(0, 9) +(19, 21) +(6, 25) +(1, 17) +(5, 21) +(0, 2) +(19, 22) +(22, 23) +(14, 19) +(5, 12) +(7, 14) +(6, 22) +(4, 23) +(13, 19) +(9, 19) +(14, 17) +(2, 23) +(6, 10) +(13, 18) +(3, 7) +(18, 20) +(0, 23) +(8, 13) +(3, 19) +(10, 16) +(7, 17) +(12, 17) +(20, 25) +(14, 16) +(3, 11) +(0, 10) +(4, 18) +(7, 15) +(5, 25) +(12, 17) +(4, 24) +(3, 15) +(9, 17) +(3, 11) +(8, 24) +(12, 18) +(13, 24) +(4, 9) +(12, 20) +(8, 21) +(3, 22) +(3, 14) +(18, 21) +(15, 20) +(2, 24) +(2, 17) +(8, 14) +(18, 19) +(1, 20) +(6, 15) +(1, 22) +(15, 25) +(2, 5) +(16, 17) +(19, 23) +(15, 21) +(5, 8) +(2, 8) +(5, 25) +(11, 15) +(11, 21) +(18, 25) +(2, 12) +(3, 5) +(3, 9) +(19, 25) +(2, 4) +(1, 11) +(15, 25) +(2, 20) +(5, 9) +(1, 24) +(4, 22) +(3, 7) +(7, 11) +(9, 13) +(17, 24) +(2, 3) +(4, 14) +(8, 24) +(17, 19) +(13, 21) +(4, 7) +(9, 23) +(18, 24) +(19, 23) +(7, 15) +(8, 19) +(4, 7) +(3, 24) +(3, 21) +(4, 18) +(7, 15) +(24, 25) +(3, 4) +(6, 7) +(3, 18) +(7, 12) +(0, 6) +(0, 2) +(7, 20) +(6, 18) +(3, 9) +(2, 18) +(0, 11) +(15, 20) +(1, 20) +(8, 15) +(4, 11) +(0, 16) +(3, 18) +(2, 7) +(8, 19) +(12, 18) +(7, 10) +(1, 11) +(20, 23) +(0, 22) +(0, 6) +(10, 16) +(8, 15) +(23, 24) +(11, 21) +(9, 11) +(21, 25) +(17, 24) +(6, 22) +(4, 15) +(3, 11) +(20, 25) +(14, 25) +(3, 12) +(11, 23) +(16, 20) +(7, 16) +(14, 19) +(4, 23) +(21, 23) +(8, 16) +(1, 19) +(2, 8) +(7, 19) +(3, 16) +(8, 11) +(17, 19) +(2, 10) +(7, 13) +(18, 19) +(1, 13) +(8, 10) +(11, 12) +(19, 20) +(5, 18) +(7, 8) +(2, 18) +(20, 23) +(5, 15) +(4, 19) +(15, 16) +(5, 7) +(2, 6) +(9, 18) +(9, 24) +(3, 18) +(10, 15) +(2, 23) +(2, 22) +(1, 9) +(16, 18) +(10, 20) +(17, 23) +(12, 15) +(8, 20) +(0, 16) +(1, 2) +(13, 15) +(12, 24) +(21, 23) +(16, 25) +(0, 18) +(3, 24) +(11, 13) +(15, 21) +(19, 24) +(4, 13) +(10, 11) +(3, 15) +(2, 21) +(6, 16) +(18, 25) +(11, 15) +(22, 24) +(12, 13) +(16, 19) +(18, 20) +(5, 6) +(4, 21) +(18, 25) +(14, 24) +(4, 10) +(6, 13) +(5, 15) +(4, 18) +(2, 14) +(10, 25) +(8, 14) +(10, 21) +(2, 8) +(9, 10) +(2, 23) +(10, 11) +(5, 8) +(5, 16) +(10, 12) +(21, 23) +(8, 11) +(5, 13) +(18, 23) +(9, 21) +(11, 19) +(0, 11) +(6, 19) +(14, 23) +(1, 21) +(9, 20) +(4, 11) +(0, 12) +(10, 21) +(3, 14) +(13, 19) +(1, 7) +(16, 19) +(1, 13) +(7, 8) +(14, 25) +(19, 22) +(6, 25) +(14, 18) +(8, 9) +(16, 24) +(17, 25) +(9, 21) +(16, 20) +(0, 24) +(3, 22) +(12, 16) +(10, 20) +(4, 22) +(8, 9) +(6, 10) +(22, 25) +(8, 12) +(7, 20) +(3, 16) +(2, 20) +(3, 19) +(7, 22) +(8, 15) +(4, 16) +(0, 6) +(4, 24) +(7, 18) +(2, 10) +(6, 17) +(11, 16) +(5, 7) +(10, 19) +(17, 18) +(6, 16) +(4, 21) +(22, 24) +(9, 19) +(8, 10) +(5, 14) +(3, 24) +(2, 19) +(6, 24) +(9, 11) +(8, 22) +(2, 13) +(1, 19) +(6, 25) +(2, 20) +(1, 16) +(19, 21) +(2, 10) +(13, 19) +(1, 4) +(9, 20) +(7, 21) +(12, 21) +(13, 15) +(0, 19) +(1, 9) +(7, 11) +(2, 24) +(23, 24) +(17, 21) +(4, 13) +(7, 19) +(13, 16) +(14, 17) +(21, 22) +(1, 24) +(17, 18) +(0, 24) +(21, 25) +(20, 22) +(10, 18) +(11, 17) +(3, 25) +(15, 21) +(1, 22) +(1, 7) +(12, 25) +(13, 21) +(5, 15) +(12, 16) +(0, 13) +(3, 5) +(11, 16) +(3, 4) +(10, 12) +(6, 16) +(11, 21) +(9, 10) +(4, 5) +(12, 23) +(6, 20) +(8, 16) +(7, 21) +(12, 19) +(16, 25) +(12, 14) +(2, 19) +(15, 25) +(0, 19) +(12, 24) +(16, 18) +(17, 24) +(5, 15) +(0, 1) +(2, 16) +(12, 21) +(3, 25) +(1, 24) +(3, 11) +(7, 25) +(0, 6) +(4, 5) +(8, 15) +(1, 5) +(19, 24) +(15, 20) +(7, 12) +(4, 14) +(10, 14) +(20, 22) +(7, 12) +(8, 19) +(15, 20) +(13, 22) +(4, 20) +(12, 15) +(2, 22) +(4, 12) +(20, 23) +(2, 21) +(6, 22) +(16, 20) +(2, 12) +(0, 23) +(9, 21) +(18, 23) +(1, 16) +(20, 25) +(11, 18) +(3, 23) +(5, 25) +(20, 22) +(0, 18) +(1, 3) +(5, 19) +(17, 23) +(8, 20) +(3, 25) +(0, 10) +(5, 18) +(1, 21) +(19, 21) +(0, 15) +(4, 10) +(10, 14) +(7, 19) +(4, 12) +(0, 21) +(12, 17) +(8, 14) +(0, 20) +(12, 24) +(5, 14) +(17, 23) +(7, 20) +(13, 14) +(17, 22) +(9, 23) +(17, 18) +(23, 24) +(16, 22) +(11, 13) +(0, 22) +(2, 18) +(17, 19) +(24, 25) +(5, 23) +(13, 14) +(21, 23) +(14, 24) +(6, 17) +(1, 19) +(11, 22) +(0, 7) +(12, 25) +(18, 23) +(6, 9) +(4, 25) +(20, 21) +(10, 12) +(17, 20) +(2, 4) +(12, 22) +(9, 13) +(6, 8) +(5, 23) +(2, 15) +(4, 10) +(5, 20) +(1, 6) +(17, 21) +(6, 13) +(0, 4) +(1, 12) +(15, 20) +(9, 13) +(11, 20) +(6, 22) +(12, 25) +(10, 15) +(1, 16) +(11, 14) +(1, 8) +(10, 16) +(13, 19) +(12, 23) +(5, 20) +(9, 21) +(12, 25) +(4, 9) +(19, 22) +(11, 13) +(19, 20) +(12, 21) +(7, 22) +(24, 25) +(11, 21) +(17, 19) +(0, 22) +(7, 18) +(23, 25) +(9, 12) +(14, 18) +(6, 12) +(19, 25) +(2, 9) +(7, 14) +(3, 6) +(18, 20) +(2, 23) +(7, 16) +(17, 20) +(14, 25) +(3, 13) +(7, 16) +(2, 20) +(5, 17) +(14, 18) +(20, 23) +(2, 6) +(14, 25) +(7, 16) +(5, 18) +(17, 21) +(6, 16) +(15, 23) +(2, 8) +(9, 21) +(5, 24) +(7, 20) +(17, 23) +(8, 14) +(10, 20) +(0, 7) +(14, 25) +(1, 17) +(18, 23) +(0, 4) +(10, 19) +(13, 18) +(7, 19) +(12, 23) +(0, 2) +(11, 19) +(13, 14) +(2, 15) +(6, 7) +(1, 7) +(4, 11) +(6, 16) +(19, 22) +(2, 9) +(1, 14) +(10, 16) +(3, 19) +(9, 15) +(6, 20) +(11, 22) +(2, 19) +(15, 21) +(5, 22) +(3, 17) +(0, 20) +(5, 17) +(19, 25) +(12, 21) +(0, 24) +(9, 12) +(18, 21) +(0, 4) +(0, 17) +(8, 21) +(10, 12) +(4, 7) +(6, 9) +(2, 17) +(9, 25) +(4, 22) +(10, 20) +(3, 6) +(2, 5) +(9, 13) +(0, 6) +(4, 20) +(3, 15) +(15, 24) +(3, 11) +(13, 17) +(0, 8) +(5, 18) +(16, 18) +(6, 15) +(11, 12) +(3, 7) +(8, 14) +(3, 13) +(11, 21) +(10, 12) +(1, 8) +(9, 18) +(6, 17) +(13, 16) +(5, 21) +(9, 19) +(6, 14) +(7, 10) +(17, 23) +(5, 20) +(16, 24) +(1, 7) +(15, 21) +(10, 12) +(4, 23) +(2, 20) +(16, 25) +(9, 12) +(5, 17) +(7, 17) +(0, 20) +(5, 11) +(1, 16) +(4, 16) +(11, 21) +(17, 24) +(0, 2) +(10, 20) +(0, 16) +(4, 7) +(6, 17) +(2, 20) +(10, 14) +(21, 23) +(7, 9) +(16, 22) +(14, 15) +(1, 6) +(4, 5) +(10, 17) +(15, 20) +(1, 2) +(6, 10) +(0, 4) +(14, 17) +(10, 16) +(4, 8) +(1, 13) +(15, 18) +(0, 24) +(2, 15) +(8, 18) +(3, 4) +(0, 1) +(1, 16) +(0, 19) +(15, 21) +(2, 15) +(19, 25) +(11, 21) +(15, 23) +(2, 10) +(4, 19) +(8, 25) +(19, 20) +(12, 25) +(2, 18) +(11, 12) +(8, 25) +(16, 19) +(2, 7) +(0, 16) +(13, 25) +(8, 14) +(10, 19) +(8, 9) +(7, 16) +(10, 24) +(3, 25) +(9, 25) +(10, 15) +(3, 8) +(10, 16) +(3, 13) +(6, 9) +(2, 8) +(1, 8) +(13, 23) +(0, 6) +(10, 15) +(10, 16) +(18, 23) +(1, 10) +(12, 23) +(3, 18) +(13, 16) +(3, 5) +(20, 23) +(12, 25) +(0, 13) +(3, 22) +(20, 25) +(15, 23) +(5, 19) +(1, 19) +(8, 23) +(3, 16) +(14, 22) +(5, 10) +(1, 9) +(10, 14) +(15, 22) +(2, 16) +(0, 3) +(14, 23) +(16, 21) +(0, 19) +(2, 25) +(3, 11) +(1, 17) +(3, 18) +(4, 25) +(6, 17) +(20, 21) +(2, 17) +(10, 18) +(3, 24) +(1, 4) +(6, 22) +(1, 9) +(14, 17) +(3, 7) +(4, 19) +(22, 24) +(10, 15) +(1, 16) +(2, 22) +(14, 24) +(7, 17) +(12, 15) +(10, 20) +(7, 23) +(11, 20) +(0, 10) +(3, 22) +(9, 14) +(1, 11) +(7, 16) +(20, 25) +(9, 17) +(10, 15) +(0, 8) +(14, 25) +(9, 13) +(17, 19) +(1, 12) +(9, 24) +(13, 19) +(14, 21) +(1, 3) +(11, 25) +(17, 23) +(0, 14) +(9, 10) +(3, 12) +(14, 22) +(10, 24) +(8, 9) +(0, 12) +(10, 20) +(2, 9) +(18, 24) +(11, 12) +(18, 22) +(3, 11) +(9, 24) +(5, 10) +(6, 12) +(12, 25) +(9, 20) +(6, 8) +(2, 24) +(11, 19) +(16, 18) +(3, 17) +(12, 19) +(7, 18) +(11, 17) +(1, 2) +(3, 23) +(24, 25) +(0, 9) +(17, 22) +(19, 25) +(2, 24) +(11, 20) +(5, 9) +(1, 16) +(0, 6) +(15, 20) +(5, 10) +(3, 9) +(14, 17) +(6, 22) +(5, 8) +(1, 15) +(2, 6) +(18, 20) +(9, 25) +(10, 21) +(3, 8) +(4, 5) +(6, 24) +(17, 18) +(11, 21) +(1, 19) +(10, 12) +(0, 11) +(12, 22) +(1, 6) +(0, 3) +(13, 22) +(5, 11) +(0, 1) +(5, 23) +(3, 14) +(10, 22) +(19, 23) +(10, 13) +(18, 22) +(3, 5) +(6, 23) +(5, 9) +(3, 16) +(19, 24) +(22, 25) +(5, 14) +(4, 19) +(7, 24) +(11, 16) +(7, 8) +(15, 16) +(6, 24) +(1, 14) +(3, 4) +(19, 22) +(5, 19) +(2, 24) +(7, 12) +(8, 23) +(3, 25) +(4, 10) +(4, 13) +(6, 8) +(23, 25) +(0, 10) +(12, 14) +(2, 9) +(10, 15) +(11, 13) +(18, 25) +(2, 20) +(6, 9) +(4, 16) +(0, 7) +(7, 25) +(1, 13) +(0, 8) +(9, 16) +(14, 18) +(2, 21) +(11, 17) +(1, 15) +(2, 20) +(18, 22) +(12, 17) +(21, 25) +(0, 17) +(1, 13) +(8, 12) +(14, 20) +(1, 10) +(13, 24) +(3, 20) +(14, 18) +(0, 22) +(22, 24) +(3, 17) +(20, 23) +(1, 4) +(10, 11) +(4, 6) +(10, 21) +(7, 22) +(22, 24) +(6, 9) +(9, 17) +(24, 25) +(7, 22) +(4, 7) +(1, 22) +(12, 17) +(10, 22) +(5, 12) +(7, 8) +(1, 25) +(7, 19) +(24, 25) +(8, 23) +(3, 19) +(5, 25) +(15, 23) +(6, 24) +(16, 19) +(3, 4) +(3, 21) +(7, 19) +(4, 22) +(13, 16) +(13, 17) +(2, 19) +(7, 18) +(1, 21) +(0, 4) +(4, 15) +(1, 24) +(7, 11) +(13, 21) +(2, 3) +(9, 18) +(18, 25) +(0, 11) +(16, 24) +(3, 12) +(2, 8) +(0, 14) +(2, 13) +(6, 8) +(15, 24) +(10, 18) +(8, 12) +(10, 11) +(19, 24) +(2, 23) +(13, 18) +(13, 25) +(1, 8) +(10, 11) +(2, 6) +(8, 14) +(11, 22) +(6, 21) +(1, 12) +(12, 20) +(15, 22) +(1, 23) +(5, 6) +(19, 21) +(7, 8) +(1, 4) +(12, 16) +(8, 24) +(17, 23) +(6, 14) +(4, 20) +(2, 24) +(5, 6) +(15, 16) +(21, 23) +(7, 20) +(11, 16) +(6, 14) +(3, 4) +(6, 10) +(16, 22) +(9, 14) +(5, 16) +(1, 10) +(6, 17) +(3, 9) +(14, 24) +(17, 25) +(10, 12) +(5, 21) +(6, 13) +(9, 24) +(16, 24) +(10, 15) +(4, 13) +(0, 12) +(2, 6) +(0, 11) +(16, 24) +(4, 6) +(3, 15) +(10, 23) +(12, 19) +(3, 22) +(2, 19) +(15, 18) +(1, 11) +(16, 24) +(0, 11) +(2, 25) +(12, 24) +(10, 16) +(8, 22) +(1, 17) +(14, 15) +(18, 20) +(17, 24) +(0, 22) +(2, 15) +(1, 23) +(18, 19) +(14, 21) +(3, 16) +(5, 10) +(0, 8) +(7, 19) +(3, 6) +(20, 23) +(1, 18) +(3, 14) +(6, 13) +(20, 21) +(8, 24) +(0, 7) +(1, 9) +(4, 13) +(21, 25) +(6, 19) +(9, 11) +(7, 15) +(1, 17) +(8, 23) +(8, 12) +(19, 22) +(9, 25) +(4, 13) +(1, 15) +(11, 18) +(7, 22) +(8, 17) +(4, 13) +(5, 25) +(4, 11) +(22, 23) +(15, 25) +(3, 17) +(2, 8) +(5, 8) +(2, 12) +(6, 11) +(7, 17) +(4, 16) +(10, 23) +(19, 23) +(0, 2) +(1, 6) +(9, 12) +(16, 21) +(9, 22) +(12, 19) +(0, 5) +(1, 11) +(2, 8) +(1, 24) +(4, 11) +(17, 19) +(1, 3) +(10, 24) +(11, 20) +(15, 24) +(20, 25) +(21, 25) +(15, 19) +(14, 20) +(17, 24) +(6, 25) +(14, 23) +(13, 21) +(4, 20) +(3, 13) +(12, 14) +(4, 22) +(4, 16) +(3, 5) +(7, 22) +(14, 25) +(16, 18) +(4, 6) +(5, 19) +(17, 18) +(4, 21) +(6, 11) +(11, 18) +(20, 21) +(16, 20) +(4, 16) +(4, 13) +(0, 16) +(4, 17) +(13, 14) +(7, 13) +(17, 23) +(5, 14) +(4, 25) +(2, 7) +(10, 17) +(11, 13) +(4, 24) +(14, 23) +(13, 15) +(2, 25) +(14, 17) +(21, 23) +(1, 4) +(12, 25) +(1, 15) +(16, 17) +(14, 23) +(8, 13) +(2, 22) +(16, 18) +(11, 14) +(2, 5) +(6, 12) +(4, 13) +(14, 22) +(13, 24) +(5, 15) +(6, 19) +(2, 25) +(9, 11) +(6, 21) +(10, 13) +(19, 25) +(6, 18) +(19, 22) +(13, 17) +(10, 16) +(2, 19) +(4, 13) +(10, 15) +(8, 18) +(6, 21) +(4, 17) +(18, 23) +(19, 24) +(3, 6) +(1, 13) +(19, 24) +(1, 21) +(6, 13) +(4, 18) +(3, 7) +(19, 22) +(1, 14) +(2, 3) +(4, 18) +(6, 25) +(0, 13) +(0, 2) +(4, 24) +(5, 14) +(18, 25) +(13, 15) +(15, 16) +(13, 19) +(5, 22) +(0, 3) +(4, 9) +(9, 10) +(19, 21) +(1, 22) +(16, 17) +(0, 5) +(4, 11) +(17, 23) +(4, 8) +(6, 9) +(10, 13) +(0, 7) +(2, 6) +(9, 11) +(20, 23) +(8, 16) +(10, 21) +(10, 22) +(1, 9) +(3, 11) +(5, 20) +(3, 21) +(1, 13) +(9, 22) +(10, 16) +(3, 19) +(15, 21) +(3, 19) \ No newline at end of file diff --git a/04-08-amidakuji/04-small.txt b/04-08-amidakuji/04-small.txt new file mode 100644 index 0000000..5258d03 --- /dev/null +++ b/04-08-amidakuji/04-small.txt @@ -0,0 +1,20 @@ +(2, 3) +(2, 6) +(3, 7) +(5, 6) +(0, 1) +(0, 1) +(6, 7) +(2, 5) +(6, 9) +(4, 8) +(0, 2) +(5, 7) +(4, 8) +(1, 5) +(6, 8) +(6, 9) +(2, 5) +(1, 8) +(5, 7) +(2, 9) \ No newline at end of file diff --git a/04-08-amidakuji/amidakuji-creation.ipynb b/04-08-amidakuji/amidakuji-creation.ipynb new file mode 100644 index 0000000..c08756e --- /dev/null +++ b/04-08-amidakuji/amidakuji-creation.ipynb @@ -0,0 +1,2288 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import collections\n", + "import random\n", + "import string\n", + "import itertools" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "Link = collections.namedtuple('Link', 'height left right')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def link_ends(link):\n", + " return set((link.left, link.right))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def can_add(link, links):\n", + " ends = link_ends(link)\n", + " same_height_links = [l for l in links if l.height == link.height]\n", + " return all(ends.isdisjoint(link_ends(l)) for l in same_height_links)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def make_net(num_links, lines=10, height=50):\n", + " links = set()\n", + " while len(links) < num_links:\n", + " a = random.randrange(lines)\n", + " b = random.randrange(lines)\n", + " if a != b:\n", + " l = min(a, b)\n", + " r = max(a, b)\n", + " h = random.randrange(height)\n", + " link = Link(h, l, r)\n", + " if can_add(link, links):\n", + " links.add(link)\n", + " return links" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{Link(height=2, left=0, right=3),\n", + " Link(height=2, left=1, right=7),\n", + " Link(height=3, left=1, right=8),\n", + " Link(height=9, left=6, right=9),\n", + " Link(height=15, left=0, right=4),\n", + " Link(height=20, left=0, right=8),\n", + " Link(height=23, left=3, right=4),\n", + " Link(height=24, left=3, right=6),\n", + " Link(height=28, left=1, right=8),\n", + " Link(height=28, left=5, right=6),\n", + " Link(height=32, left=1, right=7),\n", + " Link(height=34, left=1, right=9),\n", + " Link(height=36, left=0, right=4),\n", + " Link(height=38, left=5, right=6),\n", + " Link(height=40, left=0, right=2),\n", + " Link(height=41, left=3, right=7),\n", + " Link(height=43, left=2, right=4),\n", + " Link(height=43, left=6, right=8),\n", + " Link(height=44, left=0, right=6),\n", + " Link(height=46, left=7, right=8)}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "net = make_net(20)\n", + "net" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow(initial_line, links):\n", + " line = initial_line\n", + " heights = sorted(set(l.height for l in links))\n", + " for h in heights:\n", + " for l in [l for l in links if l.height == h]:\n", + " if line in link_ends(l):\n", + " line = [e for e in link_ends(l) if e != line][0]\n", + "# print(l, line)\n", + " return line" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "follow(4, net)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def pack(net):\n", + " packed_links = []\n", + " line_heights = collections.defaultdict(lambda: -1)\n", + " for link in sorted(net):\n", + " link_height = max(line_heights[link.left], line_heights[link.right]) + 1\n", + " line_heights[link.left] = link_height\n", + " line_heights[link.right] = link_height\n", + " packed_links += [Link(link_height, link.left, link.right)]\n", + " return sorted(packed_links)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow_many_slow(in_sequence, links):\n", + " out_sequence = [(follow(i, links), term) \n", + " for i, term in enumerate(in_sequence)]\n", + " return [term for i, term in sorted(out_sequence)]" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow_many(in_sequence, net):\n", + " height_groups = [list(g) for _, g in itertools.groupby(pack(net), lambda l: l.height)]\n", + " seq = list(in_sequence)\n", + " for links in height_groups:\n", + " for link in links:\n", + "# l = seq[link.left]\n", + "# r = seq[link.right]\n", + "# seq[link.right] = l\n", + "# seq[link.left] = r\n", + " seq[link.right], seq[link.left] = seq[link.left], seq[link.right]\n", + " return seq" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10000 loops, best of 3: 45.7 µs per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many('abcdefghij', net)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# %%timeit\n", + "# follow_many_slow('abcdefghij', net)" + ] + }, + { + "cell_type": "code", + "execution_count": 104, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def show_net(links, randomise=False, pair_sep=', '):\n", + " if randomise:\n", + " output = []\n", + " heights = sorted(set(l.height for l in links))\n", + " for h in heights:\n", + " ls = [l for l in links if l.height == h]\n", + " random.shuffle(ls)\n", + " output += ['({}, {})'.format(l.left, l.right) for l in ls]\n", + " return pair_sep.join(output)\n", + " return pair_sep.join('({}, {})'.format(l.left, l.right) for l in sorted(links))" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'(0, 3), (1, 7), (1, 8), (6, 9), (0, 4), (0, 8), (3, 4), (3, 6), (1, 8), (5, 6), (1, 7), (1, 9), (0, 4), (5, 6), (0, 2), (3, 7), (2, 4), (6, 8), (0, 6), (7, 8)'" + ] + }, + "execution_count": 105, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show_net(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 106, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'(1, 7), (0, 3), (1, 8), (6, 9), (0, 4), (0, 8), (3, 4), (3, 6), (5, 6), (1, 8), (1, 7), (1, 9), (0, 4), (5, 6), (0, 2), (3, 7), (6, 8), (2, 4), (0, 6), (7, 8)'" + ] + }, + "execution_count": 106, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show_net(net, randomise=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 110, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'(0, 3) : (1, 7) : (1, 8) : (6, 9) : (0, 4) : (0, 8) : (3, 4) : (3, 6) : (1, 8) : (5, 6) : (1, 7) : (1, 9) : (0, 4) : (5, 6) : (0, 2) : (3, 7) : (2, 4) : (6, 8) : (0, 6) : (7, 8)'" + ] + }, + "execution_count": 110, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show_net(net, pair_sep=' : ')" + ] + }, + { + "cell_type": "code", + "execution_count": 111, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'(0, 3)\\n(1, 7)\\n(1, 8)\\n(6, 9)\\n(0, 4)\\n(0, 8)\\n(3, 4)\\n(3, 6)\\n(1, 8)\\n(5, 6)\\n(1, 7)\\n(1, 9)\\n(0, 4)\\n(5, 6)\\n(0, 2)\\n(3, 7)\\n(2, 4)\\n(6, 8)\\n(0, 6)\\n(7, 8)'" + ] + }, + "execution_count": 111, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show_net(net, pair_sep='\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": 112, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(0, 3)\n", + "(1, 7)\n", + "(1, 8)\n", + "(6, 9)\n", + "(0, 4)\n", + "(0, 8)\n", + "(3, 4)\n", + "(3, 6)\n", + "(1, 8)\n", + "(5, 6)\n", + "(1, 7)\n", + "(1, 9)\n", + "(0, 4)\n", + "(5, 6)\n", + "(0, 2)\n", + "(3, 7)\n", + "(2, 4)\n", + "(6, 8)\n", + "(0, 6)\n", + "(7, 8)\n" + ] + } + ], + "source": [ + "print(show_net(net, pair_sep='\\n'))" + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'(0, 3), (1, 7), (1, 8), (6, 9), (0, 4), (0, 8), (3, 4), (3, 6), (1, 8), (5, 6), (1, 7), (1, 9), (0, 4), (5, 6), (0, 2), (3, 7), (2, 4), (6, 8), (0, 6), (7, 8)'" + ] + }, + "execution_count": 108, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show_net(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ls = [l for l in net if l.height == 1]\n", + "ls" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "random.shuffle(ls)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_net(net_string):\n", + " return [Link(h, l, r) for h, (l, r) in enumerate(extract_pairs(net_string))]" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def extract_pairs(net_string):\n", + " return [[int(pi) for pi in p.split(', ')] for p in net_string[1:-1].split('), (')]" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=0, left=0, right=3),\n", + " Link(height=1, left=1, right=7),\n", + " Link(height=2, left=1, right=8),\n", + " Link(height=3, left=6, right=9),\n", + " Link(height=4, left=0, right=4),\n", + " Link(height=5, left=0, right=8),\n", + " Link(height=6, left=3, right=4),\n", + " Link(height=7, left=3, right=6),\n", + " Link(height=8, left=1, right=8),\n", + " Link(height=9, left=5, right=6),\n", + " Link(height=10, left=1, right=7),\n", + " Link(height=11, left=1, right=9),\n", + " Link(height=12, left=0, right=4),\n", + " Link(height=13, left=5, right=6),\n", + " Link(height=14, left=0, right=2),\n", + " Link(height=15, left=3, right=7),\n", + " Link(height=16, left=2, right=4),\n", + " Link(height=17, left=6, right=8),\n", + " Link(height=18, left=0, right=6),\n", + " Link(height=19, left=7, right=8)]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "read_net(show_net(net))" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=0, left=0, right=3),\n", + " Link(height=0, left=1, right=7),\n", + " Link(height=0, left=6, right=9),\n", + " Link(height=1, left=0, right=4),\n", + " Link(height=1, left=1, right=8),\n", + " Link(height=2, left=0, right=8),\n", + " Link(height=2, left=3, right=4),\n", + " Link(height=3, left=0, right=4),\n", + " Link(height=3, left=1, right=8),\n", + " Link(height=3, left=3, right=6),\n", + " Link(height=4, left=0, right=2),\n", + " Link(height=4, left=1, right=7),\n", + " Link(height=4, left=5, right=6),\n", + " Link(height=5, left=1, right=9),\n", + " Link(height=5, left=2, right=4),\n", + " Link(height=5, left=3, right=7),\n", + " Link(height=5, left=5, right=6),\n", + " Link(height=6, left=6, right=8),\n", + " Link(height=7, left=0, right=6),\n", + " Link(height=7, left=7, right=8)]" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pack(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=0, left=0, right=3),\n", + " Link(height=0, left=1, right=7),\n", + " Link(height=0, left=6, right=9),\n", + " Link(height=1, left=0, right=4),\n", + " Link(height=1, left=1, right=8),\n", + " Link(height=2, left=0, right=8),\n", + " Link(height=2, left=3, right=4),\n", + " Link(height=3, left=0, right=4),\n", + " Link(height=3, left=1, right=8),\n", + " Link(height=3, left=3, right=6),\n", + " Link(height=4, left=0, right=2),\n", + " Link(height=4, left=1, right=7),\n", + " Link(height=4, left=5, right=6),\n", + " Link(height=5, left=1, right=9),\n", + " Link(height=5, left=2, right=4),\n", + " Link(height=5, left=3, right=7),\n", + " Link(height=5, left=5, right=6),\n", + " Link(height=6, left=6, right=8),\n", + " Link(height=7, left=0, right=6),\n", + " Link(height=7, left=7, right=8)]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pack(read_net(show_net(net)))" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(False, True)" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pnet = pack(net)\n", + "rrnet = read_net(show_net(net, randomise=True))\n", + "rnet = read_net(show_net(net))\n", + "rnet == rrnet, pack(rrnet) == pnet" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "lnet = make_net(10207, 26, 100000)\n", + "plnet = pack(lnet)\n", + "assert follow_many(string.ascii_lowercase, lnet) == follow_many(string.ascii_lowercase, plnet)\n", + "# for i in range(204):\n", + "# assert follow(i, lnet) == follow(i, plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "rlnet = read_net(show_net(lnet))\n", + "prlnet = pack(rlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2224" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "99998" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10206" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in rlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2224" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in prlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, lnet) == follow_many(string.ascii_lowercase, prlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 23.4 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many(string.ascii_lowercase, lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# %%timeit\n", + "# follow_many_slow(string.ascii_lowercase, lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pairs_slow(net):\n", + " eps = []\n", + " for l in net:\n", + " o = Link(l.height + 1, l.left, l.right)\n", + " if o in net:\n", + " eps += [(l, o)]\n", + " return eps " + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pairs(net):\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + " eps = []\n", + " for h in range(1, max(height_groups.keys())):\n", + " for l in height_groups[h]:\n", + " o = Link(l.height - 1, l.left, l.right)\n", + " if o in height_groups[h-1]:\n", + " eps += [(l, o)]\n", + " return eps" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 23.5 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "eliminable_pairs(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pair(net):\n", + " for l in net:\n", + " o = Link(l.height + 1, l.left, l.right)\n", + " if o in net:\n", + " return l, o\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pair_hg(height_groups):\n", + " for h in range(1, max(height_groups.keys())):\n", + " for l in height_groups[h]:\n", + " o = Link(l.height - 1, l.left, l.right)\n", + " if o in height_groups[h-1]:\n", + " return l, o\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_pairs_slow(net):\n", + " eliminable_links = eliminable_pair(net)\n", + " while eliminable_links:\n", + " net = pack(l for l in net if l not in eliminable_links)\n", + " eliminable_links = eliminable_pair(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_pairs(net):\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + " eliminable_links = eliminable_pair_hg(height_groups)\n", + " while eliminable_links:\n", + " net = pack(l for l in net if l not in eliminable_links)\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + " eliminable_links = eliminable_pair_hg(height_groups)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10207\n" + ] + }, + { + "data": { + "text/plain": [ + "(10207, 9839)" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "print(len(plnet))\n", + "elnet = eliminate_pairs(plnet)\n", + "len(plnet), len(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eliminable_pairs(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, lnet) == follow_many(string.ascii_lowercase, elnet)\n", + "assert follow_many(string.ascii_lowercase, plnet) == follow_many(string.ascii_lowercase, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 loop, best of 3: 5.77 s per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "elnet = eliminate_pairs(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# for i in range(26):\n", + "# assert follow(i, plnet) == follow(i, elnet)\n", + "# assert follow(i, lnet) == follow(i, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# follow(0, plnet), follow(0, elnet), follow(0, lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def triple_slow(net):\n", + " x = None\n", + " y = None\n", + " ts = []\n", + " for a in net:\n", + " bs = [l for l in net if l.height == a.height + 1 \n", + " if l.left == a.right or l.right == a.left]\n", + " for b in bs:\n", + " c = Link(a.height + 2, a.left, a.right)\n", + " if c in net:\n", + " ts += [(a, b, c)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def triple_pair_slow(net):\n", + " ts = []\n", + " for a in net:\n", + " a_ends = link_ends(a)\n", + " bs = [l for l in net if l.height == a.height + 1 \n", + " if link_ends(l) & a_ends]\n", + " if len(bs) == 1:\n", + " b = bs[0]\n", + " lines = set((a.left, a.right, b.left, b.right))\n", + " cs = [l for l in net \n", + " if l.height == a.height + 2\n", + " if link_ends(l) & lines]\n", + " if len(cs) == 1:\n", + " c = Link(a.height + 2, a.left, a.right)\n", + " if c in cs:\n", + " ds = [l for l in net \n", + " if l.height == a.height + 3\n", + " if link_ends(l) & lines]\n", + " d = Link(a.height + 3, b.left, b.right)\n", + " if d in ds:\n", + " ts += [(a, b, c, d)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def find_height_groups(net):\n", + " return {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "def triple_pair_hg(height_groups, debug=False):\n", + " ts = []\n", + " for h in range(3, max(height_groups.keys())):\n", + " for d in height_groups[h]:\n", + " if debug: print('d:', d)\n", + " ch = h - 1\n", + " cs = [l for l in height_groups[ch] if link_ends(l) & link_ends(d)]\n", + " if debug: print('cs:', cs)\n", + " while ch > 2 and not cs:\n", + " ch -= 1\n", + " cs = [l for l in height_groups[ch] if link_ends(l) & link_ends(d)]\n", + " if debug: print('cs:', cs)\n", + " if len(cs) == 1:\n", + " c = cs[0]\n", + " lines = set((d.left, d.right, c.left, c.right))\n", + " if debug: print('c:', '; lines:', lines)\n", + " bs = [l for l in height_groups[ch-1] if link_ends(l) & lines]\n", + " b = Link(ch - 1, d.left, d.right)\n", + " if debug: print('b:', b, '; bs:', bs)\n", + " if len(bs) == 1 and b in bs:\n", + " ah = b.height - 1\n", + " als = [l for l in height_groups[ah] if link_ends(l) & link_ends(c)]\n", + " if debug: print('ah:', ah, '; als:', als)\n", + " while ah > 0 and not als:\n", + " ah -= 1\n", + " als = [l for l in height_groups[ah] if link_ends(l) & link_ends(c)]\n", + " if debug: print('ah:', ah, '; als:', als)\n", + " a = Link(ah, c.left, c.right)\n", + " if debug: print('a:', a)\n", + " if a in als:\n", + " if debug: print('adding:', a, b, c, d)\n", + " ts += [(a, b, c, d)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_a_triple_pair_slow(net, debug=False):\n", + " tps = triple_pair_slow(net)\n", + " if debug: print('eatp', tps)\n", + "\n", + " if tps:\n", + " a, b, c, d = tps[0]\n", + "# x = Link(a.height, b.left, b.right)\n", + "# y = Link(b.height, a.left, a.right)\n", + " x = Link(b.height - 0.5, b.left, b.right)\n", + " y = Link(b.height, a.left, a.right)\n", + " if debug: print('removing', a, b, c, d, '; adding', x, y)\n", + " return pack([l for l in net if l not in [a, b, c, d]] + [x, y])\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_a_triple_pair(net, debug=False):\n", + " height_groups = find_height_groups(net)\n", + "\n", + " tps = triple_pair_hg(height_groups)\n", + " if debug: print('eatp', tps)\n", + " if tps:\n", + " a, b, c, d = tps[0]\n", + " x = Link(b.height - 0.5, b.left, b.right)\n", + " y = Link(b.height, a.left, a.right)\n", + " if debug: print('removing', a, b, c, d, '; adding', x, y)\n", + " return pack([l for l in net if l not in [a, b, c, d]] + [x, y])\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=831, left=8, right=16),\n", + " Link(height=832, left=8, right=25),\n", + " Link(height=833, left=8, right=16),\n", + " Link(height=834, left=8, right=25)),\n", + " (Link(height=1657, left=1, right=13),\n", + " Link(height=1658, left=1, right=12),\n", + " Link(height=1659, left=1, right=13),\n", + " Link(height=1660, left=1, right=12))]" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "height_groups = find_height_groups(elnet)\n", + "triple_pair_hg(height_groups)" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 99.4 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "height_groups = find_height_groups(elnet)\n", + "triple_pair_hg(height_groups)" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_triple_pairs_slow(net):\n", + " print(len(net))\n", + " new_net = eliminate_a_triple_pair_slow(net)\n", + " while new_net:\n", + " print(len(net))\n", + " net = new_net\n", + " new_net = eliminate_a_triple_pair_slow(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_triple_pairs(net):\n", + " print(len(net))\n", + " new_net = eliminate_a_triple_pair(net)\n", + " while new_net:\n", + " print(len(net))\n", + " net = new_net\n", + " new_net = eliminate_a_triple_pair(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [], + "source": [ + "etlnet = eliminate_a_triple_pair(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, etlnet) == follow_many(string.ascii_lowercase, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9839\n", + "9839\n", + "9837\n" + ] + } + ], + "source": [ + "setlnet = eliminate_triple_pairs(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9835" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(setlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, etlnet) == follow_many(string.ascii_lowercase, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'buxphgtzqykfawvomcjresnldi'" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, etlnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'buxphgtzqykfawvomcjresnldi'" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, setlnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'buxphgtzqykfawvomcjresnldi'" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, elnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'buxphgtzqykfawvomcjresnldi'" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eliminable_pairs(etlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(10207, 9837)" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(lnet), len(etlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def simplify(net0):\n", + " netp = eliminate_pairs(net0)\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " while new_net:\n", + "# print('sipl', len(net0), len(netp), len(new_net))\n", + " netp = eliminate_pairs(new_net)\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " return netp" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [], + "source": [ + "simple_lnet = simplify(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, simple_lnet)) == ''.join(follow_many(string.ascii_lowercase, lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'buxphgtzqykfawvomcjresnldi'" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, simple_lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'buxphgtzqykfawvomcjresnldi'" + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9835" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(simple_lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def add_triple_pair(net, max_lines=None, trace=False):\n", + " if not max_lines:\n", + " max_lines = max(l.right for l in net)\n", + " a, b, c = 0, 0, 0\n", + " while len(set((a, b, c))) != 3:\n", + " a = random.randrange(max_lines)\n", + " b = random.randrange(max_lines)\n", + " c = random.randrange(max_lines)\n", + " tp = [(min(a, b), max(a, b)), (min(b, c), max(b, c))] * 2\n", + " \n", + " pairs = [(l.left, l.right) for l in sorted(net)]\n", + " i = random.randrange(len(pairs))\n", + " if trace: print(i, tp)\n", + " new_pairs = pairs[:i] + tp + pairs[i:]\n", + " return pack([Link(h, l, r) for h, (l, r) in enumerate(new_pairs)]) " + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def add_pair(net, max_lines=None, trace=False):\n", + " if not max_lines:\n", + " max_lines = max(l.right for l in net)\n", + "\n", + " a, b = 0, 0\n", + " while a == b:\n", + " a = random.randrange(max_lines)\n", + " b = random.randrange(max_lines)\n", + " p = [(min(a, b), max(a, b))] * 2\n", + " \n", + " pairs = [(l.left, l.right) for l in sorted(net)]\n", + " i = random.randrange(len(pairs))\n", + " \n", + " if trace: print(i, p)\n", + " new_pairs = pairs[:i] + p + pairs[i:]\n", + " return pack([Link(h, l, r) for h, (l, r) in enumerate(new_pairs)]) " + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 76, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lnettp = simple_lnet\n", + "for _ in range(10):\n", + " lnettp = add_pair(lnettp)\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(lnettp), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=195, left=5, right=10),\n", + " Link(height=197, left=1, right=5),\n", + " Link(height=198, left=5, right=10),\n", + " Link(height=199, left=1, right=5)),\n", + " (Link(height=359, left=6, right=16),\n", + " Link(height=360, left=16, right=20),\n", + " Link(height=361, left=6, right=16),\n", + " Link(height=362, left=16, right=20)),\n", + " (Link(height=409, left=0, right=9),\n", + " Link(height=410, left=9, right=16),\n", + " Link(height=411, left=0, right=9),\n", + " Link(height=412, left=9, right=16)),\n", + " (Link(height=606, left=0, right=7),\n", + " Link(height=607, left=0, right=5),\n", + " Link(height=608, left=0, right=7),\n", + " Link(height=609, left=0, right=5)),\n", + " (Link(height=967, left=7, right=19),\n", + " Link(height=968, left=19, right=23),\n", + " Link(height=969, left=7, right=19),\n", + " Link(height=970, left=19, right=23)),\n", + " (Link(height=973, left=9, right=18),\n", + " Link(height=975, left=9, right=15),\n", + " Link(height=976, left=9, right=18),\n", + " Link(height=977, left=9, right=15)),\n", + " (Link(height=1193, left=1, right=11),\n", + " Link(height=1194, left=1, right=19),\n", + " Link(height=1195, left=1, right=11),\n", + " Link(height=1196, left=1, right=19)),\n", + " (Link(height=1388, left=17, right=21),\n", + " Link(height=1389, left=6, right=17),\n", + " Link(height=1390, left=17, right=21),\n", + " Link(height=1391, left=6, right=17)),\n", + " (Link(height=1700, left=5, right=24),\n", + " Link(height=1701, left=11, right=24),\n", + " Link(height=1702, left=5, right=24),\n", + " Link(height=1703, left=11, right=24)),\n", + " (Link(height=1923, left=12, right=19),\n", + " Link(height=1924, left=19, right=24),\n", + " Link(height=1925, left=12, right=19),\n", + " Link(height=1926, left=19, right=24))]" + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lnettp = simple_lnet\n", + "for _ in range(10):\n", + " lnettp = add_triple_pair(lnettp)\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(lnettp), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=8, left=1, right=5),\n", + " Link(height=9, left=1, right=21),\n", + " Link(height=10, left=1, right=5),\n", + " Link(height=11, left=1, right=21)),\n", + " (Link(height=40, left=16, right=23),\n", + " Link(height=41, left=16, right=19),\n", + " Link(height=42, left=16, right=23),\n", + " Link(height=43, left=16, right=19)),\n", + " (Link(height=62, left=0, right=10),\n", + " Link(height=63, left=10, right=13),\n", + " Link(height=64, left=0, right=10),\n", + " Link(height=65, left=10, right=13)),\n", + " (Link(height=137, left=23, right=24),\n", + " Link(height=139, left=0, right=24),\n", + " Link(height=140, left=23, right=24),\n", + " Link(height=141, left=0, right=24)),\n", + " (Link(height=138, left=10, right=21),\n", + " Link(height=139, left=2, right=10),\n", + " Link(height=140, left=10, right=21),\n", + " Link(height=141, left=2, right=10)),\n", + " (Link(height=139, left=2, right=10),\n", + " Link(height=140, left=10, right=21),\n", + " Link(height=141, left=2, right=10),\n", + " Link(height=142, left=10, right=21)),\n", + " (Link(height=156, left=6, right=11),\n", + " Link(height=157, left=3, right=6),\n", + " Link(height=158, left=6, right=11),\n", + " Link(height=159, left=3, right=6)),\n", + " (Link(height=184, left=2, right=21),\n", + " Link(height=185, left=5, right=21),\n", + " Link(height=186, left=2, right=21),\n", + " Link(height=187, left=5, right=21)),\n", + " (Link(height=274, left=7, right=13),\n", + " Link(height=275, left=7, right=11),\n", + " Link(height=276, left=7, right=13),\n", + " Link(height=277, left=7, right=11)),\n", + " (Link(height=292, left=14, right=15),\n", + " Link(height=293, left=5, right=15),\n", + " Link(height=294, left=14, right=15),\n", + " Link(height=295, left=5, right=15)),\n", + " (Link(height=389, left=1, right=8),\n", + " Link(height=391, left=8, right=15),\n", + " Link(height=392, left=1, right=8),\n", + " Link(height=393, left=8, right=15)),\n", + " (Link(height=422, left=14, right=22),\n", + " Link(height=424, left=14, right=18),\n", + " Link(height=425, left=14, right=22),\n", + " Link(height=426, left=14, right=18)),\n", + " (Link(height=434, left=5, right=19),\n", + " Link(height=435, left=1, right=19),\n", + " Link(height=436, left=5, right=19),\n", + " Link(height=437, left=1, right=19)),\n", + " (Link(height=456, left=0, right=15),\n", + " Link(height=457, left=14, right=15),\n", + " Link(height=458, left=0, right=15),\n", + " Link(height=459, left=14, right=15)),\n", + " (Link(height=550, left=13, right=21),\n", + " Link(height=551, left=6, right=21),\n", + " Link(height=552, left=13, right=21),\n", + " Link(height=553, left=6, right=21)),\n", + " (Link(height=624, left=17, right=23),\n", + " Link(height=625, left=1, right=23),\n", + " Link(height=626, left=17, right=23),\n", + " Link(height=627, left=1, right=23)),\n", + " (Link(height=703, left=8, right=15),\n", + " Link(height=704, left=3, right=15),\n", + " Link(height=705, left=8, right=15),\n", + " Link(height=706, left=3, right=15)),\n", + " (Link(height=794, left=7, right=24),\n", + " Link(height=795, left=8, right=24),\n", + " Link(height=796, left=7, right=24),\n", + " Link(height=797, left=8, right=24)),\n", + " (Link(height=800, left=8, right=13),\n", + " Link(height=801, left=4, right=8),\n", + " Link(height=802, left=8, right=13),\n", + " Link(height=803, left=4, right=8)),\n", + " (Link(height=814, left=16, right=17),\n", + " Link(height=815, left=3, right=16),\n", + " Link(height=816, left=16, right=17),\n", + " Link(height=817, left=3, right=16)),\n", + " (Link(height=905, left=2, right=15),\n", + " Link(height=906, left=13, right=15),\n", + " Link(height=907, left=2, right=15),\n", + " Link(height=908, left=13, right=15)),\n", + " (Link(height=926, left=2, right=15),\n", + " Link(height=927, left=15, right=16),\n", + " Link(height=928, left=2, right=15),\n", + " Link(height=929, left=15, right=16)),\n", + " (Link(height=967, left=2, right=15),\n", + " Link(height=968, left=2, right=14),\n", + " Link(height=969, left=2, right=15),\n", + " Link(height=970, left=2, right=14)),\n", + " (Link(height=982, left=13, right=18),\n", + " Link(height=985, left=18, right=19),\n", + " Link(height=986, left=13, right=18),\n", + " Link(height=987, left=18, right=19)),\n", + " (Link(height=993, left=5, right=16),\n", + " Link(height=994, left=2, right=5),\n", + " Link(height=995, left=5, right=16),\n", + " Link(height=996, left=2, right=5)),\n", + " (Link(height=1058, left=9, right=24),\n", + " Link(height=1062, left=9, right=18),\n", + " Link(height=1063, left=9, right=24),\n", + " Link(height=1064, left=9, right=18)),\n", + " (Link(height=1171, left=11, right=21),\n", + " Link(height=1172, left=11, right=14),\n", + " Link(height=1173, left=11, right=21),\n", + " Link(height=1174, left=11, right=14)),\n", + " (Link(height=1294, left=0, right=11),\n", + " Link(height=1295, left=0, right=14),\n", + " Link(height=1296, left=0, right=11),\n", + " Link(height=1297, left=0, right=14)),\n", + " (Link(height=1341, left=4, right=9),\n", + " Link(height=1343, left=4, right=10),\n", + " Link(height=1344, left=4, right=9),\n", + " Link(height=1345, left=4, right=10)),\n", + " (Link(height=1342, left=12, right=18),\n", + " Link(height=1343, left=12, right=24),\n", + " Link(height=1344, left=12, right=18),\n", + " Link(height=1345, left=12, right=24)),\n", + " (Link(height=1353, left=0, right=17),\n", + " Link(height=1354, left=0, right=23),\n", + " Link(height=1355, left=0, right=17),\n", + " Link(height=1356, left=0, right=23)),\n", + " (Link(height=1367, left=4, right=16),\n", + " Link(height=1368, left=16, right=17),\n", + " Link(height=1369, left=4, right=16),\n", + " Link(height=1370, left=16, right=17)),\n", + " (Link(height=1441, left=11, right=24),\n", + " Link(height=1442, left=18, right=24),\n", + " Link(height=1443, left=11, right=24),\n", + " Link(height=1444, left=18, right=24)),\n", + " (Link(height=1451, left=6, right=20),\n", + " Link(height=1453, left=16, right=20),\n", + " Link(height=1454, left=6, right=20),\n", + " Link(height=1455, left=16, right=20)),\n", + " (Link(height=1474, left=17, right=23),\n", + " Link(height=1475, left=3, right=17),\n", + " Link(height=1476, left=17, right=23),\n", + " Link(height=1477, left=3, right=17)),\n", + " (Link(height=1550, left=8, right=23),\n", + " Link(height=1551, left=7, right=23),\n", + " Link(height=1552, left=8, right=23),\n", + " Link(height=1553, left=7, right=23)),\n", + " (Link(height=1574, left=4, right=14),\n", + " Link(height=1575, left=14, right=23),\n", + " Link(height=1576, left=4, right=14),\n", + " Link(height=1577, left=14, right=23)),\n", + " (Link(height=1580, left=0, right=1),\n", + " Link(height=1581, left=1, right=21),\n", + " Link(height=1582, left=0, right=1),\n", + " Link(height=1583, left=1, right=21)),\n", + " (Link(height=1612, left=15, right=22),\n", + " Link(height=1617, left=7, right=15),\n", + " Link(height=1618, left=15, right=22),\n", + " Link(height=1619, left=7, right=15)),\n", + " (Link(height=1644, left=12, right=18),\n", + " Link(height=1646, left=12, right=20),\n", + " Link(height=1647, left=12, right=18),\n", + " Link(height=1648, left=12, right=20)),\n", + " (Link(height=1716, left=13, right=24),\n", + " Link(height=1719, left=14, right=24),\n", + " Link(height=1720, left=13, right=24),\n", + " Link(height=1721, left=14, right=24)),\n", + " (Link(height=1735, left=3, right=24),\n", + " Link(height=1736, left=3, right=21),\n", + " Link(height=1737, left=3, right=24),\n", + " Link(height=1738, left=3, right=21)),\n", + " (Link(height=1736, left=3, right=21),\n", + " Link(height=1737, left=3, right=24),\n", + " Link(height=1738, left=3, right=21),\n", + " Link(height=1739, left=3, right=24)),\n", + " (Link(height=1776, left=0, right=21),\n", + " Link(height=1777, left=13, right=21),\n", + " Link(height=1778, left=0, right=21),\n", + " Link(height=1779, left=13, right=21)),\n", + " (Link(height=1783, left=7, right=9),\n", + " Link(height=1784, left=7, right=12),\n", + " Link(height=1785, left=7, right=9),\n", + " Link(height=1786, left=7, right=12)),\n", + " (Link(height=1929, left=10, right=24),\n", + " Link(height=1930, left=8, right=24),\n", + " Link(height=1931, left=10, right=24),\n", + " Link(height=1932, left=8, right=24)),\n", + " (Link(height=1935, left=4, right=23),\n", + " Link(height=1936, left=3, right=4),\n", + " Link(height=1937, left=4, right=23),\n", + " Link(height=1938, left=3, right=4)),\n", + " (Link(height=2043, left=4, right=7),\n", + " Link(height=2044, left=7, right=15),\n", + " Link(height=2045, left=4, right=7),\n", + " Link(height=2046, left=7, right=15)),\n", + " (Link(height=2045, left=8, right=19),\n", + " Link(height=2051, left=8, right=15),\n", + " Link(height=2052, left=8, right=19),\n", + " Link(height=2053, left=8, right=15)),\n", + " (Link(height=2172, left=10, right=15),\n", + " Link(height=2173, left=10, right=16),\n", + " Link(height=2174, left=10, right=15),\n", + " Link(height=2175, left=10, right=16)),\n", + " (Link(height=2214, left=22, right=24),\n", + " Link(height=2215, left=7, right=22),\n", + " Link(height=2216, left=22, right=24),\n", + " Link(height=2217, left=7, right=22)),\n", + " (Link(height=2231, left=5, right=6),\n", + " Link(height=2232, left=6, right=14),\n", + " Link(height=2233, left=5, right=6),\n", + " Link(height=2234, left=6, right=14))]" + ] + }, + "execution_count": 93, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lnettp = simple_lnet\n", + "for _ in range(50):\n", + " lnettp = add_pair(lnettp)\n", + "for _ in range(50):\n", + " lnettp = add_triple_pair(lnettp)\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(lnettp), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 94, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lnettp == pack(lnettp)" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "9931" + ] + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lnettps = simplify(lnettp)\n", + "len(lnettps)" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(9835, 10135, 9931)" + ] + }, + "execution_count": 96, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(simple_lnet), len(lnettp), len(lnettps)" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 97, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnet)) == ''.join(follow_many(string.ascii_lowercase, simple_lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 98, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnettps)) == ''.join(follow_many(string.ascii_lowercase, lnettp))" + ] + }, + { + "cell_type": "code", + "execution_count": 99, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2286" + ] + }, + "execution_count": 99, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in lnettp)" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def simplify_with_checks(net0):\n", + " netp = eliminate_pairs(net0)\n", + " if follow_many(string.ascii_lowercase, net0) != follow_many(string.ascii_lowercase, netp):\n", + " print('pairs', eliminable_pairs(net0))\n", + " return net0\n", + " else:\n", + " print('pairs ok')\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " if new_net and follow_many(string.ascii_lowercase, new_net) != follow_many(string.ascii_lowercase, netp):\n", + " hg = find_height_groups(netp)\n", + " print('triple', triple_pair_hg(hg))\n", + " return netp\n", + " else:\n", + " print('triple ok')\n", + " while new_net:\n", + "# print('sipl', len(net0), len(netp), len(new_net))\n", + " netp = eliminate_pairs(new_net)\n", + " if follow_many(string.ascii_lowercase, new_net) != follow_many(string.ascii_lowercase, netp):\n", + " print('pairs', eliminable_pairs(new_net))\n", + " return new_net\n", + " else:\n", + " print('pairs ok')\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " if new_net and follow_many(string.ascii_lowercase, new_net) != follow_many(string.ascii_lowercase, netp):\n", + " hg = find_height_groups(netp)\n", + " print('triple', triple_pair_hg(hg))\n", + " return netp\n", + " else:\n", + " print('triple ok')\n", + " print('** done')\n", + " return netp" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "** done\n" + ] + } + ], + "source": [ + "lnettps = simplify_with_checks(lnettp)" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnettps)) == ''.join(follow_many(string.ascii_lowercase, lnettp))" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10135" + ] + }, + "execution_count": 103, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(lnettp)" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "83459" + ] + }, + "execution_count": 113, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open('04-lines.txt', 'w').write(show_net(lnettp, randomise=True, pair_sep='\\n'))" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "139" + ] + }, + "execution_count": 114, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "open('04-small.txt', 'w').write(show_net(make_net(20), randomise=True, pair_sep='\\n'))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04-08-amidakuji/amidakuji-solution-1-slow.ipynb b/04-08-amidakuji/amidakuji-solution-1-slow.ipynb new file mode 100644 index 0000000..345321d --- /dev/null +++ b/04-08-amidakuji/amidakuji-solution-1-slow.ipynb @@ -0,0 +1,1881 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import collections\n", + "import string\n", + "import itertools" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "Link = collections.namedtuple('Link', 'height left right')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def link_ends(link):\n", + " return set((link.left, link.right))" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_net(net_string):\n", + " return [Link(h, l, r) for h, (l, r) in enumerate(extract_pairs(net_string))]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow(initial_line, links):\n", + " line = initial_line\n", + " heights = sorted(set(l.height for l in links))\n", + " for h in heights:\n", + " for l in [l for l in links if l.height == h]:\n", + " if line in link_ends(l):\n", + " line = [e for e in link_ends(l) if e != line][0]\n", + "# print(l, line)\n", + " return line" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def pack(net):\n", + " packed_links = []\n", + " line_heights = collections.defaultdict(lambda: -1)\n", + " for link in sorted(net):\n", + " link_height = max(line_heights[link.left], line_heights[link.right]) + 1\n", + " line_heights[link.left] = link_height\n", + " line_heights[link.right] = link_height\n", + " packed_links += [Link(link_height, link.left, link.right)]\n", + " return sorted(packed_links)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow_many_slow(in_sequence, links):\n", + " out_sequence = [(follow(i, links), term) \n", + " for i, term in enumerate(in_sequence)]\n", + " return [term for i, term in sorted(out_sequence)]" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow_many(in_sequence, net):\n", + " height_groups = [list(g) for _, g in itertools.groupby(pack(net), lambda l: l.height)]\n", + " seq = list(in_sequence)\n", + " for links in height_groups:\n", + " for link in links:\n", + " seq[link.right], seq[link.left] = seq[link.left], seq[link.right]\n", + " return seq" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10000 loops, best of 3: 47.5 µs per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many('abcdefghij', net)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# %%timeit\n", + "# follow_many_slow('abcdefghij', net)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def show_net(links, randomise=False):\n", + " if randomise:\n", + " output = []\n", + " heights = sorted(set(l.height for l in links))\n", + " for h in heights:\n", + " ls = [l for l in links if l.height == h]\n", + " random.shuffle(ls)\n", + " output += ['({}, {})'.format(l.left, l.right) for l in ls]\n", + " return ', '.join(output)\n", + " return ', '.join('({}, {})'.format(l.left, l.right) for l in sorted(links))" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def extract_pairs(net_string):\n", + " return [[int(pi) for pi in p.split(', ')] for p in net_string[1:-1].split('), (')]" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(True, True)" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rrnet = read_net(show_net(net, randomise=True))\n", + "rnet = read_net(show_net(net))\n", + "rnet == rrnet, pack(rrnet) == pnet" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "lnet = make_net(10207, 26, 100000)\n", + "plnet = pack(lnet)\n", + "assert follow_many(string.ascii_lowercase, lnet) == follow_many(string.ascii_lowercase, plnet)\n", + "# for i in range(204):\n", + "# assert follow(i, lnet) == follow(i, plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "rlnet = read_net(show_net(lnet))\n", + "prlnet = pack(rlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2251" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "99998" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10206" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in rlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2251" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(link.height for link in prlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, lnet) == follow_many(string.ascii_lowercase, prlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 24.5 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many(string.ascii_lowercase, lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# %%timeit\n", + "# follow_many_slow(string.ascii_lowercase, lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pairs_slow(net):\n", + " eps = []\n", + " for l in net:\n", + " o = Link(l.height + 1, l.left, l.right)\n", + " if o in net:\n", + " eps += [(l, o)]\n", + " return eps " + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pairs(net):\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + " eps = []\n", + " for h in range(1, max(height_groups.keys())):\n", + " for l in height_groups[h]:\n", + " o = Link(l.height - 1, l.left, l.right)\n", + " if o in height_groups[h-1]:\n", + " eps += [(l, o)]\n", + " return eps" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 23.5 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "eliminable_pairs(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 loop, best of 3: 2.33 s per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "eliminable_pairs_slow(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert sorted(sorted(p) for p in eliminable_pairs(plnet)) == sorted(sorted(p) for p in eliminable_pairs_slow(plnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pair(net):\n", + " for l in net:\n", + " o = Link(l.height + 1, l.left, l.right)\n", + " if o in net:\n", + " return l, o\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pair_hg(height_groups):\n", + " for h in range(1, max(height_groups.keys())):\n", + " for l in height_groups[h]:\n", + " o = Link(l.height - 1, l.left, l.right)\n", + " if o in height_groups[h-1]:\n", + " return l, o\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_pairs_slow(net):\n", + " eliminable_links = eliminable_pair(net)\n", + " while eliminable_links:\n", + " net = pack(l for l in net if l not in eliminable_links)\n", + " eliminable_links = eliminable_pair(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_pairs(net):\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + " eliminable_links = eliminable_pair_hg(height_groups)\n", + " while eliminable_links:\n", + " net = pack(l for l in net if l not in eliminable_links)\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + " eliminable_links = eliminable_pair_hg(height_groups)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10207\n" + ] + }, + { + "data": { + "text/plain": [ + "(10207, 9811)" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "print(len(plnet))\n", + "elnet = eliminate_pairs_slow(plnet)\n", + "len(plnet), len(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10207\n" + ] + }, + { + "data": { + "text/plain": [ + "(10207, 9811)" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "print(len(plnet))\n", + "elnet = eliminate_pairs(plnet)\n", + "len(plnet), len(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eliminable_pairs(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert eliminate_pairs_slow(plnet) == eliminate_pairs(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, lnet) == follow_many(string.ascii_lowercase, elnet)\n", + "assert follow_many(string.ascii_lowercase, plnet) == follow_many(string.ascii_lowercase, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 loop, best of 3: 3min 30s per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "elnet = eliminate_pairs_slow(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 loop, best of 3: 6.27 s per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "elnet = eliminate_pairs(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# for i in range(26):\n", + "# assert follow(i, plnet) == follow(i, elnet)\n", + "# assert follow(i, lnet) == follow(i, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# follow(0, plnet), follow(0, elnet), follow(0, lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def triple(net):\n", + " x = None\n", + " y = None\n", + " ts = []\n", + " for a in net:\n", + " bs = [l for l in net if l.height == a.height + 1 \n", + " if l.left == a.right or l.right == a.left]\n", + " for b in bs:\n", + " c = Link(a.height + 2, a.left, a.right)\n", + " if c in net:\n", + " ts += [(a, b, c)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def triple_pair(net):\n", + " ts = []\n", + " for a in net:\n", + " a_ends = link_ends(a)\n", + " bs = [l for l in net if l.height == a.height + 1 \n", + " if link_ends(l) & a_ends]\n", + " if len(bs) == 1:\n", + " b = bs[0]\n", + " lines = set((a.left, a.right, b.left, b.right))\n", + " cs = [l for l in net \n", + " if l.height == a.height + 2\n", + " if link_ends(l) & lines]\n", + " if len(cs) == 1:\n", + " c = Link(a.height + 2, a.left, a.right)\n", + " if c in cs:\n", + " ds = [l for l in net \n", + " if l.height == a.height + 3\n", + " if link_ends(l) & lines]\n", + " d = Link(a.height + 3, b.left, b.right)\n", + " if d in ds:\n", + " ts += [(a, b, c, d)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def triple_pair_hg(height_groups, debug=False):\n", + " ts = []\n", + " for h in range(3, max(height_groups.keys())):\n", + " for d in height_groups[h]:\n", + " if debug: print('d:', d)\n", + " ch = h - 1\n", + " cs = [l for l in height_groups[ch] if link_ends(l) & link_ends(d)]\n", + " if debug: print('cs:', cs)\n", + " while ch > 2 and not cs:\n", + " ch -= 1\n", + " cs = [l for l in height_groups[ch] if link_ends(l) & link_ends(d)]\n", + " if debug: print('cs:', cs)\n", + " if len(cs) == 1:\n", + " c = cs[0]\n", + " lines = set((d.left, d.right, c.left, c.right))\n", + " if debug: print('c:', '; lines:', lines)\n", + " bs = [l for l in height_groups[ch-1] if link_ends(l) & lines]\n", + " b = Link(ch - 1, d.left, d.right)\n", + " if debug: print('b:', b, '; bs:', bs)\n", + " if len(bs) == 1 and b in bs:\n", + " ah = b.height - 1\n", + " als = [l for l in height_groups[ah] if link_ends(l) & link_ends(c)]\n", + " if debug: print('ah:', ah, '; als:', als)\n", + " while ah > 0 and not als:\n", + " ah -= 1\n", + " als = [l for l in height_groups[ah] if link_ends(l) & link_ends(c)]\n", + " if debug: print('ah:', ah, '; als:', als)\n", + " a = Link(ah, c.left, c.right)\n", + " if debug: print('a:', a)\n", + " if a in als:\n", + " if debug: print('adding:', a, b, c, d)\n", + " ts += [(a, b, c, d)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_a_triple_pair_slow(net):\n", + " tps = triple_pair(net)\n", + " print('eatp', tps)\n", + "\n", + " if tps:\n", + " a, b, c, d = tps[0]\n", + "# x = Link(a.height, b.left, b.right)\n", + "# y = Link(b.height, a.left, a.right)\n", + " x = Link(a.height, b.left, b.right)\n", + " y = Link(b.height, a.left, a.right)\n", + " print('removing', a, b, c, d, '; adding', x, y)\n", + " return pack([l for l in net if l not in [a, b, c, d]] + [x, y])\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_a_triple_pair(net):\n", + " height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + "\n", + " tps = triple_pair_hg(height_groups)\n", + " print('eatp', tps)\n", + " if tps:\n", + " a, b, c, d = tps[0]\n", + " x = Link(a.height, b.left, b.right)\n", + " y = Link(b.height, a.left, a.right)\n", + " print('removing', a, b, c, d, '; adding', x, y)\n", + " return pack([l for l in net if l not in [a, b, c, d]] + [x, y])\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=12, left=0, right=5),\n", + " Link(height=13, left=5, right=11),\n", + " Link(height=14, left=0, right=5)),\n", + " (Link(height=29, left=2, right=18),\n", + " Link(height=30, left=1, right=2),\n", + " Link(height=31, left=2, right=18)),\n", + " (Link(height=40, left=2, right=3),\n", + " Link(height=41, left=3, right=18),\n", + " Link(height=42, left=2, right=3)),\n", + " (Link(height=43, left=1, right=10),\n", + " Link(height=44, left=10, right=20),\n", + " Link(height=45, left=1, right=10)),\n", + " (Link(height=91, left=5, right=8),\n", + " Link(height=92, left=3, right=5),\n", + " Link(height=93, left=5, right=8)),\n", + " (Link(height=91, left=5, right=8),\n", + " Link(height=92, left=8, right=18),\n", + " Link(height=93, left=5, right=8)),\n", + " (Link(height=99, left=13, right=17),\n", + " Link(height=100, left=4, right=13),\n", + " Link(height=101, left=13, right=17)),\n", + " (Link(height=120, left=18, right=20),\n", + " Link(height=121, left=9, right=18),\n", + " Link(height=122, left=18, right=20)),\n", + " (Link(height=147, left=19, right=21),\n", + " Link(height=148, left=7, right=19),\n", + " Link(height=149, left=19, right=21)),\n", + " (Link(height=147, left=19, right=21),\n", + " Link(height=148, left=21, right=23),\n", + " Link(height=149, left=19, right=21)),\n", + " (Link(height=179, left=13, right=25),\n", + " Link(height=180, left=12, right=13),\n", + " Link(height=181, left=13, right=25)),\n", + " (Link(height=265, left=3, right=20),\n", + " Link(height=266, left=20, right=23),\n", + " Link(height=267, left=3, right=20)),\n", + " (Link(height=291, left=5, right=23),\n", + " Link(height=292, left=2, right=5),\n", + " Link(height=293, left=5, right=23)),\n", + " (Link(height=292, left=18, right=25),\n", + " Link(height=293, left=0, right=18),\n", + " Link(height=294, left=18, right=25)),\n", + " (Link(height=302, left=11, right=19),\n", + " Link(height=303, left=6, right=11),\n", + " Link(height=304, left=11, right=19)),\n", + " (Link(height=309, left=15, right=20),\n", + " Link(height=310, left=20, right=25),\n", + " Link(height=311, left=15, right=20)),\n", + " (Link(height=325, left=13, right=18),\n", + " Link(height=326, left=11, right=13),\n", + " Link(height=327, left=13, right=18)),\n", + " (Link(height=362, left=11, right=22),\n", + " Link(height=363, left=22, right=24),\n", + " Link(height=364, left=11, right=22)),\n", + " (Link(height=372, left=22, right=23),\n", + " Link(height=373, left=1, right=22),\n", + " Link(height=374, left=22, right=23)),\n", + " (Link(height=386, left=4, right=17),\n", + " Link(height=387, left=17, right=21),\n", + " Link(height=388, left=4, right=17)),\n", + " (Link(height=393, left=4, right=16),\n", + " Link(height=394, left=0, right=4),\n", + " Link(height=395, left=4, right=16)),\n", + " (Link(height=531, left=0, right=4),\n", + " Link(height=532, left=4, right=15),\n", + " Link(height=533, left=0, right=4)),\n", + " (Link(height=575, left=5, right=21),\n", + " Link(height=576, left=1, right=5),\n", + " Link(height=577, left=5, right=21)),\n", + " (Link(height=639, left=7, right=11),\n", + " Link(height=640, left=11, right=17),\n", + " Link(height=641, left=7, right=11)),\n", + " (Link(height=687, left=2, right=4),\n", + " Link(height=688, left=4, right=15),\n", + " Link(height=689, left=2, right=4)),\n", + " (Link(height=706, left=8, right=11),\n", + " Link(height=707, left=11, right=22),\n", + " Link(height=708, left=8, right=11)),\n", + " (Link(height=722, left=22, right=23),\n", + " Link(height=723, left=21, right=22),\n", + " Link(height=724, left=22, right=23)),\n", + " (Link(height=768, left=9, right=11),\n", + " Link(height=769, left=11, right=17),\n", + " Link(height=770, left=9, right=11)),\n", + " (Link(height=792, left=5, right=12),\n", + " Link(height=793, left=12, right=17),\n", + " Link(height=794, left=5, right=12)),\n", + " (Link(height=805, left=20, right=22),\n", + " Link(height=806, left=19, right=20),\n", + " Link(height=807, left=20, right=22)),\n", + " (Link(height=806, left=19, right=20),\n", + " Link(height=807, left=18, right=19),\n", + " Link(height=808, left=19, right=20)),\n", + " (Link(height=806, left=19, right=20),\n", + " Link(height=807, left=20, right=22),\n", + " Link(height=808, left=19, right=20)),\n", + " (Link(height=882, left=7, right=14),\n", + " Link(height=883, left=14, right=22),\n", + " Link(height=884, left=7, right=14)),\n", + " (Link(height=884, left=6, right=11),\n", + " Link(height=885, left=11, right=19),\n", + " Link(height=886, left=6, right=11)),\n", + " (Link(height=892, left=12, right=17),\n", + " Link(height=893, left=10, right=12),\n", + " Link(height=894, left=12, right=17)),\n", + " (Link(height=916, left=18, right=24),\n", + " Link(height=917, left=16, right=18),\n", + " Link(height=918, left=18, right=24)),\n", + " (Link(height=919, left=14, right=17),\n", + " Link(height=920, left=6, right=14),\n", + " Link(height=921, left=14, right=17)),\n", + " (Link(height=994, left=0, right=3),\n", + " Link(height=995, left=3, right=24),\n", + " Link(height=996, left=0, right=3)),\n", + " (Link(height=1012, left=9, right=12),\n", + " Link(height=1013, left=12, right=24),\n", + " Link(height=1014, left=9, right=12)),\n", + " (Link(height=1034, left=1, right=6),\n", + " Link(height=1035, left=6, right=12),\n", + " Link(height=1036, left=1, right=6)),\n", + " (Link(height=1035, left=7, right=21),\n", + " Link(height=1036, left=4, right=7),\n", + " Link(height=1037, left=7, right=21)),\n", + " (Link(height=1047, left=3, right=10),\n", + " Link(height=1048, left=10, right=11),\n", + " Link(height=1049, left=3, right=10)),\n", + " (Link(height=1088, left=7, right=8),\n", + " Link(height=1089, left=8, right=14),\n", + " Link(height=1090, left=7, right=8)),\n", + " (Link(height=1104, left=3, right=10),\n", + " Link(height=1105, left=10, right=11),\n", + " Link(height=1106, left=3, right=10)),\n", + " (Link(height=1135, left=5, right=8),\n", + " Link(height=1136, left=8, right=19),\n", + " Link(height=1137, left=5, right=8)),\n", + " (Link(height=1138, left=1, right=3),\n", + " Link(height=1139, left=3, right=23),\n", + " Link(height=1140, left=1, right=3)),\n", + " (Link(height=1146, left=5, right=7),\n", + " Link(height=1147, left=7, right=24),\n", + " Link(height=1148, left=5, right=7)),\n", + " (Link(height=1197, left=5, right=14),\n", + " Link(height=1198, left=14, right=15),\n", + " Link(height=1199, left=5, right=14)),\n", + " (Link(height=1205, left=7, right=23),\n", + " Link(height=1206, left=3, right=7),\n", + " Link(height=1207, left=7, right=23)),\n", + " (Link(height=1276, left=18, right=25),\n", + " Link(height=1277, left=17, right=18),\n", + " Link(height=1278, left=18, right=25)),\n", + " (Link(height=1319, left=14, right=20),\n", + " Link(height=1320, left=20, right=24),\n", + " Link(height=1321, left=14, right=20)),\n", + " (Link(height=1328, left=8, right=21),\n", + " Link(height=1329, left=1, right=8),\n", + " Link(height=1330, left=8, right=21)),\n", + " (Link(height=1329, left=2, right=14),\n", + " Link(height=1330, left=14, right=25),\n", + " Link(height=1331, left=2, right=14)),\n", + " (Link(height=1385, left=10, right=14),\n", + " Link(height=1386, left=14, right=15),\n", + " Link(height=1387, left=10, right=14)),\n", + " (Link(height=1419, left=2, right=8),\n", + " Link(height=1420, left=8, right=15),\n", + " Link(height=1421, left=2, right=8)),\n", + " (Link(height=1465, left=13, right=21),\n", + " Link(height=1466, left=21, right=24),\n", + " Link(height=1467, left=13, right=21)),\n", + " (Link(height=1514, left=11, right=15),\n", + " Link(height=1515, left=15, right=21),\n", + " Link(height=1516, left=11, right=15)),\n", + " (Link(height=1545, left=3, right=11),\n", + " Link(height=1546, left=11, right=25),\n", + " Link(height=1547, left=3, right=11)),\n", + " (Link(height=1561, left=7, right=18),\n", + " Link(height=1562, left=0, right=7),\n", + " Link(height=1563, left=7, right=18)),\n", + " (Link(height=1671, left=9, right=15),\n", + " Link(height=1672, left=15, right=23),\n", + " Link(height=1673, left=9, right=15)),\n", + " (Link(height=1701, left=13, right=21),\n", + " Link(height=1702, left=4, right=13),\n", + " Link(height=1703, left=13, right=21)),\n", + " (Link(height=1706, left=5, right=13),\n", + " Link(height=1707, left=13, right=23),\n", + " Link(height=1708, left=5, right=13)),\n", + " (Link(height=1730, left=7, right=16),\n", + " Link(height=1731, left=1, right=7),\n", + " Link(height=1732, left=7, right=16)),\n", + " (Link(height=1781, left=0, right=8),\n", + " Link(height=1782, left=8, right=17),\n", + " Link(height=1783, left=0, right=8)),\n", + " (Link(height=1784, left=8, right=18),\n", + " Link(height=1785, left=1, right=8),\n", + " Link(height=1786, left=8, right=18)),\n", + " (Link(height=1804, left=19, right=24),\n", + " Link(height=1805, left=7, right=19),\n", + " Link(height=1806, left=19, right=24)),\n", + " (Link(height=1827, left=3, right=23),\n", + " Link(height=1828, left=23, right=25),\n", + " Link(height=1829, left=3, right=23)),\n", + " (Link(height=1837, left=1, right=16),\n", + " Link(height=1838, left=16, right=17),\n", + " Link(height=1839, left=1, right=16)),\n", + " (Link(height=1849, left=18, right=25),\n", + " Link(height=1850, left=4, right=18),\n", + " Link(height=1851, left=18, right=25)),\n", + " (Link(height=1856, left=6, right=13),\n", + " Link(height=1857, left=13, right=17),\n", + " Link(height=1858, left=6, right=13)),\n", + " (Link(height=1875, left=2, right=11),\n", + " Link(height=1876, left=11, right=15),\n", + " Link(height=1877, left=2, right=11)),\n", + " (Link(height=1970, left=6, right=24),\n", + " Link(height=1971, left=1, right=6),\n", + " Link(height=1972, left=6, right=24)),\n", + " (Link(height=2075, left=20, right=25),\n", + " Link(height=2076, left=5, right=20),\n", + " Link(height=2077, left=20, right=25)),\n", + " (Link(height=2081, left=4, right=19),\n", + " Link(height=2082, left=1, right=4),\n", + " Link(height=2083, left=4, right=19)),\n", + " (Link(height=2111, left=3, right=25),\n", + " Link(height=2112, left=1, right=3),\n", + " Link(height=2113, left=3, right=25)),\n", + " (Link(height=2225, left=3, right=12),\n", + " Link(height=2226, left=12, right=24),\n", + " Link(height=2227, left=3, right=12)),\n", + " (Link(height=2242, left=3, right=18),\n", + " Link(height=2243, left=18, right=23),\n", + " Link(height=2244, left=3, right=18))]" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "triple(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=316, left=8, right=17),\n", + " Link(height=317, left=8, right=21),\n", + " Link(height=318, left=8, right=17),\n", + " Link(height=319, left=8, right=21)),\n", + " (Link(height=867, left=4, right=11),\n", + " Link(height=868, left=5, right=11),\n", + " Link(height=869, left=4, right=11),\n", + " Link(height=870, left=5, right=11))]" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "triple_pair(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=316, left=8, right=17),\n", + " Link(height=317, left=8, right=21),\n", + " Link(height=318, left=8, right=17),\n", + " Link(height=319, left=8, right=21)),\n", + " (Link(height=867, left=4, right=11),\n", + " Link(height=868, left=5, right=11),\n", + " Link(height=869, left=4, right=11),\n", + " Link(height=870, left=5, right=11))]" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(elnet), lambda l: l.height)}\n", + "triple_pair_hg(height_groups)" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=1368, left=13, right=19),\n", + " Link(height=1368, left=14, right=16),\n", + " Link(height=1369, left=3, right=6)]" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[l for l in elnet if l.height >= 1367 if l.height <= 1370 if link_ends(l) & set((6, 16, 19))]" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 loop, best of 3: 21.3 s per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "triple_pair(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 105 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(elnet), lambda l: l.height)}\n", + "triple_pair_hg(height_groups)" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(elnet), lambda l: l.height)}\n", + "assert triple_pair_hg(height_groups) == triple_pair(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=242, left=8, right=9),\n", + " Link(height=242, left=15, right=21),\n", + " Link(height=243, left=1, right=9),\n", + " Link(height=243, left=8, right=14),\n", + " Link(height=243, left=11, right=15),\n", + " Link(height=244, left=1, right=18),\n", + " Link(height=244, left=6, right=8),\n", + " Link(height=244, left=9, right=20),\n", + " Link(height=244, left=15, right=25),\n", + " Link(height=245, left=0, right=15),\n", + " Link(height=245, left=1, right=16),\n", + " Link(height=245, left=9, right=12),\n", + " Link(height=245, left=18, right=21)]" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[l for l in elnet if l.height >= 242 if l.height <= 245 ] #if l.left in [13, 17, 20] or l.right in [13, 17, 20]]" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_triple_pairs_slow(net):\n", + " print(len(net))\n", + " new_net = eliminate_a_triple_pair_slow(net)\n", + " while new_net:\n", + " print(len(net))\n", + " net = new_net\n", + " new_net = eliminate_a_triple_pair_slow(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 118, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_triple_pairs(net):\n", + " print(len(net))\n", + " new_net = eliminate_a_triple_pair(net)\n", + " while new_net:\n", + " print(len(net))\n", + " net = new_net\n", + " new_net = eliminate_a_triple_pair(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 134, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9811\n", + "eatp [(Link(height=316, left=8, right=17), Link(height=317, left=8, right=21), Link(height=318, left=8, right=17), Link(height=319, left=8, right=21)), (Link(height=867, left=4, right=11), Link(height=868, left=5, right=11), Link(height=869, left=4, right=11), Link(height=870, left=5, right=11))]\n", + "removing Link(height=316, left=8, right=17) Link(height=317, left=8, right=21) Link(height=318, left=8, right=17) Link(height=319, left=8, right=21) ; adding Link(height=316, left=8, right=21) Link(height=317, left=8, right=17)\n", + "9811\n", + "eatp [(Link(height=866, left=4, right=11), Link(height=867, left=5, right=11), Link(height=868, left=4, right=11), Link(height=869, left=5, right=11))]\n", + "removing Link(height=866, left=4, right=11) Link(height=867, left=5, right=11) Link(height=868, left=4, right=11) Link(height=869, left=5, right=11) ; adding Link(height=866, left=5, right=11) Link(height=867, left=4, right=11)\n", + "9809\n", + "eatp []\n" + ] + } + ], + "source": [ + "etlnet = eliminate_triple_pairs(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 112, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eatp [(Link(height=316, left=8, right=17), Link(height=317, left=8, right=21), Link(height=318, left=8, right=17), Link(height=319, left=8, right=21)), (Link(height=867, left=4, right=11), Link(height=868, left=5, right=11), Link(height=869, left=4, right=11), Link(height=870, left=5, right=11))]\n", + "removing Link(height=316, left=8, right=17) Link(height=317, left=8, right=21) Link(height=318, left=8, right=17) Link(height=319, left=8, right=21) ; adding Link(height=317, left=8, right=17) Link(height=318, left=8, right=21)\n" + ] + } + ], + "source": [ + "etlnet = eliminate_a_triple_pair(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 135, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, etlnet) == follow_many(string.ascii_lowercase, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=315, left=17, right=20),\n", + " Link(height=316, left=8, right=17),\n", + " Link(height=317, left=8, right=21),\n", + " Link(height=318, left=8, right=17),\n", + " Link(height=319, left=8, right=21),\n", + " Link(height=319, left=14, right=17),\n", + " Link(height=320, left=2, right=8),\n", + " Link(height=320, left=17, right=21)]" + ] + }, + "execution_count": 136, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[l for l in elnet if l.height >= 315 if l.height <= 320 if link_ends(l) & set((8, 17, 21))] " + ] + }, + { + "cell_type": "code", + "execution_count": 137, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=0, left=17, right=20),\n", + " Link(height=1, left=8, right=17),\n", + " Link(height=2, left=8, right=21),\n", + " Link(height=3, left=8, right=17),\n", + " Link(height=4, left=8, right=21),\n", + " Link(height=4, left=14, right=17),\n", + " Link(height=5, left=2, right=8),\n", + " Link(height=5, left=17, right=21)]" + ] + }, + "execution_count": 137, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nf = [l for l in elnet if l.height >= 315 if l.height <= 320 if link_ends(l) & set((8, 17, 21))]\n", + "pnf = pack(nf)\n", + "pnf" + ] + }, + { + "cell_type": "code", + "execution_count": 138, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d: Link(height=3, left=8, right=17)\n", + "cs: [Link(height=2, left=8, right=21)]\n", + "c: ; lines: {8, 17, 21}\n", + "b: Link(height=1, left=8, right=17) ; bs: [Link(height=1, left=8, right=17)]\n", + "ah: 0 ; als: []\n", + "a: Link(height=0, left=8, right=21)\n", + "d: Link(height=4, left=8, right=21)\n", + "cs: [Link(height=3, left=8, right=17)]\n", + "c: ; lines: {8, 17, 21}\n", + "b: Link(height=2, left=8, right=21) ; bs: [Link(height=2, left=8, right=21)]\n", + "ah: 1 ; als: [Link(height=1, left=8, right=17)]\n", + "a: Link(height=1, left=8, right=17)\n", + "adding: Link(height=1, left=8, right=17) Link(height=2, left=8, right=21) Link(height=3, left=8, right=17) Link(height=4, left=8, right=21)\n", + "d: Link(height=4, left=14, right=17)\n", + "cs: [Link(height=3, left=8, right=17)]\n", + "c: ; lines: {8, 17, 14}\n", + "b: Link(height=2, left=14, right=17) ; bs: [Link(height=2, left=8, right=21)]\n" + ] + }, + { + "data": { + "text/plain": [ + "[(Link(height=1, left=8, right=17),\n", + " Link(height=2, left=8, right=21),\n", + " Link(height=3, left=8, right=17),\n", + " Link(height=4, left=8, right=21))]" + ] + }, + "execution_count": 138, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(pnf), lambda l: l.height)}\n", + "triple_pair_hg(height_groups, debug=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 139, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9811\n", + "eatp [(Link(height=316, left=8, right=17), Link(height=317, left=8, right=21), Link(height=318, left=8, right=17), Link(height=319, left=8, right=21)), (Link(height=867, left=4, right=11), Link(height=868, left=5, right=11), Link(height=869, left=4, right=11), Link(height=870, left=5, right=11))]\n", + "removing Link(height=316, left=8, right=17) Link(height=317, left=8, right=21) Link(height=318, left=8, right=17) Link(height=319, left=8, right=21) ; adding Link(height=316, left=8, right=21) Link(height=317, left=8, right=17)\n", + "9811\n", + "eatp [(Link(height=866, left=4, right=11), Link(height=867, left=5, right=11), Link(height=868, left=4, right=11), Link(height=869, left=5, right=11))]\n", + "removing Link(height=866, left=4, right=11) Link(height=867, left=5, right=11) Link(height=868, left=4, right=11) Link(height=869, left=5, right=11) ; adding Link(height=866, left=5, right=11) Link(height=867, left=4, right=11)\n", + "9809\n", + "eatp []\n" + ] + } + ], + "source": [ + "setlnet = eliminate_triple_pairs_slow(elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 140, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9807" + ] + }, + "execution_count": 140, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(setlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 141, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, etlnet) == follow_many(string.ascii_lowercase, elnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 142, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zdunvslcfiqywjmkobhxtraegp'" + ] + }, + "execution_count": 142, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, etlnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 143, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zdunvslcfiqywjmkobhxtraegp'" + ] + }, + "execution_count": 143, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, setlnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 144, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zdunvslcfiqywjmkobhxtraegp'" + ] + }, + "execution_count": 144, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, elnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 145, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zdunvslcfiqywjmkobhxtraegp'" + ] + }, + "execution_count": 145, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 146, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 146, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eliminable_pairs(etlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 147, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(10207, 9807)" + ] + }, + "execution_count": 147, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(lnet), len(etlnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 148, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def simplify(net0):\n", + " netp = eliminate_pairs(net0)\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " while new_net:\n", + "# print('sipl', len(net0), len(netp), len(new_net))\n", + " netp = eliminate_pairs(new_net)\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " return netp" + ] + }, + { + "cell_type": "code", + "execution_count": 149, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eatp [(Link(height=316, left=8, right=17), Link(height=317, left=8, right=21), Link(height=318, left=8, right=17), Link(height=319, left=8, right=21)), (Link(height=867, left=4, right=11), Link(height=868, left=5, right=11), Link(height=869, left=4, right=11), Link(height=870, left=5, right=11))]\n", + "removing Link(height=316, left=8, right=17) Link(height=317, left=8, right=21) Link(height=318, left=8, right=17) Link(height=319, left=8, right=21) ; adding Link(height=316, left=8, right=21) Link(height=317, left=8, right=17)\n", + "eatp [(Link(height=866, left=4, right=11), Link(height=867, left=5, right=11), Link(height=868, left=4, right=11), Link(height=869, left=5, right=11))]\n", + "removing Link(height=866, left=4, right=11) Link(height=867, left=5, right=11) Link(height=868, left=4, right=11) Link(height=869, left=5, right=11) ; adding Link(height=866, left=5, right=11) Link(height=867, left=4, right=11)\n", + "eatp []\n" + ] + } + ], + "source": [ + "simple_lnet = simplify(plnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 150, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 150, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, simple_lnet)) == ''.join(follow_many(string.ascii_lowercase, lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 151, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zdunvslcfiqywjmkobhxtraegp'" + ] + }, + "execution_count": 151, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, simple_lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 152, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'zdunvslcfiqywjmkobhxtraegp'" + ] + }, + "execution_count": 152, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, lnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 153, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9807" + ] + }, + "execution_count": 153, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(simple_lnet)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def add_triple_pair(net, max_lines=None):\n", + " if not max_lines:\n", + " max_lines = max(l.right for l in net)\n", + " a, b, c = 0, 0, 0\n", + " while len(set((a, b, c))) != 3:\n", + " a = random.randrange(max_lines)\n", + " b = random.randrange(max_lines)\n", + " c = random.randrange(max_lines)\n", + " tp = [(min(a, b), max(a, b)), (min(b, c), max(b, c))] * 2\n", + " \n", + " pairs = [(l.left, l.right) for l in sorted(net)]\n", + " i = random.randrange(len(pairs))\n", + " print(i, tp)\n", + " new_pairs = pairs[:i] + tp + pairs[i:]\n", + " return pack([Link(h, l, r) for h, (l, r) in enumerate(new_pairs)]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def add_pair(net, max_lines=None):\n", + " if not max_lines:\n", + " max_lines = max(l.right for l in net)\n", + "\n", + " a, b = 0, 0\n", + " while a == b:\n", + " a = random.randrange(max_lines)\n", + " b = random.randrange(max_lines)\n", + " p = [(min(a, b), max(a, b))] * 2\n", + " \n", + " pairs = [(l.left, l.right) for l in sorted(net)]\n", + " i = random.randrange(len(pairs))\n", + " \n", + " print(i, p)\n", + " new_pairs = pairs[:i] + p + pairs[i:]\n", + " return pack([Link(h, l, r) for h, (l, r) in enumerate(new_pairs)]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "scrolled": true + }, + "outputs": [], + "source": [ + "lnettp = simple_lnet\n", + "for _ in range(10):\n", + " lnettp = add_pair(lnettp)\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(lnettp), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "scrolled": true + }, + "outputs": [], + "source": [ + "lnettp = simple_lnet\n", + "for _ in range(10):\n", + " lnettp = add_triple_pair(lnettp)\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(lnettp), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "scrolled": true + }, + "outputs": [], + "source": [ + "lnettp = simple_lnet\n", + "for _ in range(10):\n", + " lnettp = add_pair(lnettp)\n", + "for _ in range(10):\n", + " lnettp = add_triple_pair(lnettp)\n", + "height_groups = {h: list(g) for h, g in itertools.groupby(pack(lnettp), lambda l: l.height)}\n", + "tps = triple_pair_hg(height_groups)\n", + "tps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "lnettp == pack(lnettp)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "lnettps = simplify(lnettp)\n", + "len(lnettps)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "len(simple_lnet), len(lnettp), len(lnettps)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04-08-amidakuji/amidakuji-solution-1.ipynb b/04-08-amidakuji/amidakuji-solution-1.ipynb new file mode 100644 index 0000000..d9a9249 --- /dev/null +++ b/04-08-amidakuji/amidakuji-solution-1.ipynb @@ -0,0 +1,416 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import collections\n", + "import string\n", + "import itertools\n", + "import re" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "Link = collections.namedtuple('Link', 'height left right')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def extract_pairs(net_string):\n", + " return [[int(pi) for pi in p.split(', ')] for p in net_string[1:-1].split('), (')]" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_net_string(net_string):\n", + " return [Link(h, l, r) for h, (l, r) in enumerate(extract_pairs(net_string))]" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_net(filename):\n", + " with open(filename) as f:\n", + " pairs = [re.split('\\D+', p.strip()) for p in f.readlines()]\n", + " lrs = [(int(lr[1]), int(lr[2])) for lr in pairs]\n", + " return [Link(h, l, r) \n", + " for h, (l, r) in enumerate(lrs)]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=0, left=2, right=3),\n", + " Link(height=1, left=2, right=6),\n", + " Link(height=2, left=3, right=7),\n", + " Link(height=3, left=5, right=6),\n", + " Link(height=4, left=0, right=1),\n", + " Link(height=5, left=0, right=1),\n", + " Link(height=6, left=6, right=7),\n", + " Link(height=7, left=2, right=5),\n", + " Link(height=8, left=6, right=9),\n", + " Link(height=9, left=4, right=8),\n", + " Link(height=10, left=0, right=2),\n", + " Link(height=11, left=5, right=7),\n", + " Link(height=12, left=4, right=8),\n", + " Link(height=13, left=1, right=5),\n", + " Link(height=14, left=6, right=8),\n", + " Link(height=15, left=6, right=9),\n", + " Link(height=16, left=2, right=5),\n", + " Link(height=17, left=1, right=8),\n", + " Link(height=18, left=5, right=7),\n", + " Link(height=19, left=2, right=9)]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "small_net = read_net('04-small.txt')\n", + "small_net" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10135" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "net = read_net('04-lines.txt')\n", + "len(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def show_net(links, pair_sep=', '):\n", + " return pair_sep.join('({}, {})'.format(l.left, l.right) for l in sorted(links))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def link_ends(link):\n", + " return set((link.left, link.right))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow(initial_line, links):\n", + " line = initial_line\n", + " heights = sorted(set(l.height for l in links))\n", + " for h in heights:\n", + " for l in [l for l in links if l.height == h]:\n", + " if line in link_ends(l):\n", + " line = [e for e in link_ends(l) if e != line][0]\n", + "# print(l, line)\n", + " return line" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def pack(net):\n", + " packed_links = []\n", + " line_heights = collections.defaultdict(lambda: -1)\n", + " for link in sorted(net):\n", + " link_height = max(line_heights[link.left], line_heights[link.right]) + 1\n", + " line_heights[link.left] = link_height\n", + " line_heights[link.right] = link_height\n", + " packed_links += [Link(link_height, link.left, link.right)]\n", + " return sorted(packed_links)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "19" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in small_net)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "7" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in pack(small_net))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10134" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in net)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "pnet = pack(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2286" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def height_groups(net):\n", + " return {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow_many(in_sequence, net):\n", + " hgs = height_groups(net)\n", + " seq = list(in_sequence)\n", + " for h in hgs:\n", + " for link in hgs[h]:\n", + " seq[link.right], seq[link.left] = seq[link.left], seq[link.right]\n", + " return seq" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'djihegcafb'" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many('abcdefghij', small_net))" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10000 loops, best of 3: 50.4 µs per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many('abcdefghij', small_net)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, net))" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 21 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many(string.ascii_lowercase, net)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04-08-amidakuji/amidakuji-solution-2.ipynb b/04-08-amidakuji/amidakuji-solution-2.ipynb new file mode 100644 index 0000000..8fc722f --- /dev/null +++ b/04-08-amidakuji/amidakuji-solution-2.ipynb @@ -0,0 +1,1457 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import collections\n", + "import string\n", + "import itertools\n", + "import re" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "Link = collections.namedtuple('Link', 'height left right')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def extract_pairs(net_string):\n", + " return [[int(pi) for pi in p.split(', ')] for p in net_string[1:-1].split('), (')]" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_net_string(net_string):\n", + " return [Link(h, l, r) for h, (l, r) in enumerate(extract_pairs(net_string))]" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_net(filename):\n", + " with open(filename) as f:\n", + " pairs = [re.split('\\D+', p.strip()) for p in f.readlines()]\n", + " lrs = [(int(lr[1]), int(lr[2])) for lr in pairs]\n", + " return [Link(h, l, r) \n", + " for h, (l, r) in enumerate(lrs)]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Link(height=0, left=2, right=3),\n", + " Link(height=1, left=2, right=6),\n", + " Link(height=2, left=3, right=7),\n", + " Link(height=3, left=5, right=6),\n", + " Link(height=4, left=0, right=1),\n", + " Link(height=5, left=0, right=1),\n", + " Link(height=6, left=6, right=7),\n", + " Link(height=7, left=2, right=5),\n", + " Link(height=8, left=6, right=9),\n", + " Link(height=9, left=4, right=8),\n", + " Link(height=10, left=0, right=2),\n", + " Link(height=11, left=5, right=7),\n", + " Link(height=12, left=4, right=8),\n", + " Link(height=13, left=1, right=5),\n", + " Link(height=14, left=6, right=8),\n", + " Link(height=15, left=6, right=9),\n", + " Link(height=16, left=2, right=5),\n", + " Link(height=17, left=1, right=8),\n", + " Link(height=18, left=5, right=7),\n", + " Link(height=19, left=2, right=9)]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "small_net = read_net('04-small.txt')\n", + "small_net" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10135" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "net = read_net('04-lines.txt')\n", + "len(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def show_net(links, pair_sep=', '):\n", + " return pair_sep.join('({}, {})'.format(l.left, l.right) for l in sorted(links))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def link_ends(link):\n", + " return set((link.left, link.right))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow(initial_line, links):\n", + " line = initial_line\n", + " heights = sorted(set(l.height for l in links))\n", + " for h in heights:\n", + " for l in [l for l in links if l.height == h]:\n", + " if line in link_ends(l):\n", + " line = [e for e in link_ends(l) if e != line][0]\n", + "# print(l, line)\n", + " return line" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def pack(net):\n", + " packed_links = []\n", + " line_heights = collections.defaultdict(lambda: -1)\n", + " for link in sorted(net):\n", + " link_height = max(line_heights[link.left], line_heights[link.right]) + 1\n", + " line_heights[link.left] = link_height\n", + " line_heights[link.right] = link_height\n", + " packed_links += [Link(link_height, link.left, link.right)]\n", + " return sorted(packed_links)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "19" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in small_net)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "7" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in pack(small_net))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10134" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in net)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2286" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(l.height for l in pack(net))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def height_groups(net):\n", + " return {h: list(g) for h, g in itertools.groupby(pack(net), lambda l: l.height)}" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def follow_many(in_sequence, net):\n", + " hgs = height_groups(net)\n", + " seq = list(in_sequence)\n", + " for h in hgs:\n", + " for link in hgs[h]:\n", + " seq[link.right], seq[link.left] = seq[link.left], seq[link.right]\n", + " return seq" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'djihegcafb'" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many('abcdefghij', small_net))" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10000 loops, best of 3: 50.2 µs per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many('abcdefghij', small_net)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, net))" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 20.7 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "follow_many(string.ascii_lowercase, net)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "pnet = pack(net)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pairs(net):\n", + " hgs = height_groups(net)\n", + " eps = []\n", + " for h in range(1, max(hgs.keys())):\n", + " for l in hgs[h]:\n", + " o = Link(l.height - 1, l.left, l.right)\n", + " if o in hgs[h-1]:\n", + " eps += [(l, o)]\n", + " return eps" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=115, left=2, right=23), Link(height=114, left=2, right=23)),\n", + " (Link(height=149, left=15, right=23), Link(height=148, left=15, right=23)),\n", + " (Link(height=201, left=0, right=7), Link(height=200, left=0, right=7)),\n", + " (Link(height=207, left=22, right=23), Link(height=206, left=22, right=23)),\n", + " (Link(height=210, left=17, right=23), Link(height=209, left=17, right=23)),\n", + " (Link(height=247, left=16, right=20), Link(height=246, left=16, right=20)),\n", + " (Link(height=418, left=19, right=24), Link(height=417, left=19, right=24)),\n", + " (Link(height=424, left=9, right=21), Link(height=423, left=9, right=21)),\n", + " (Link(height=453, left=3, right=16), Link(height=452, left=3, right=16)),\n", + " (Link(height=456, left=2, right=22), Link(height=455, left=2, right=22)),\n", + " (Link(height=465, left=18, right=20), Link(height=464, left=18, right=20)),\n", + " (Link(height=491, left=14, right=18), Link(height=490, left=14, right=18)),\n", + " (Link(height=552, left=16, right=17), Link(height=551, left=16, right=17)),\n", + " (Link(height=772, left=0, right=7), Link(height=771, left=0, right=7)),\n", + " (Link(height=848, left=1, right=2), Link(height=847, left=1, right=2)),\n", + " (Link(height=895, left=6, right=21), Link(height=894, left=6, right=21)),\n", + " (Link(height=930, left=11, right=13), Link(height=929, left=11, right=13)),\n", + " (Link(height=987, left=8, right=17), Link(height=986, left=8, right=17)),\n", + " (Link(height=988, left=8, right=17), Link(height=987, left=8, right=17)),\n", + " (Link(height=1030, left=9, right=24), Link(height=1029, left=9, right=24)),\n", + " (Link(height=1134, left=4, right=23), Link(height=1133, left=4, right=23)),\n", + " (Link(height=1163, left=14, right=15), Link(height=1162, left=14, right=15)),\n", + " (Link(height=1164, left=14, right=15), Link(height=1163, left=14, right=15)),\n", + " (Link(height=1170, left=2, right=21), Link(height=1169, left=2, right=21)),\n", + " (Link(height=1232, left=6, right=22), Link(height=1231, left=6, right=22)),\n", + " (Link(height=1254, left=13, right=15), Link(height=1253, left=13, right=15)),\n", + " (Link(height=1255, left=1, right=24), Link(height=1254, left=1, right=24)),\n", + " (Link(height=1324, left=3, right=22), Link(height=1323, left=3, right=22)),\n", + " (Link(height=1370, left=15, right=19), Link(height=1369, left=15, right=19)),\n", + " (Link(height=1441, left=0, right=14), Link(height=1440, left=0, right=14)),\n", + " (Link(height=1441, left=11, right=24), Link(height=1440, left=11, right=24)),\n", + " (Link(height=1547, left=11, right=13), Link(height=1546, left=11, right=13)),\n", + " (Link(height=1578, left=14, right=23), Link(height=1577, left=14, right=23)),\n", + " (Link(height=1616, left=7, right=14), Link(height=1615, left=7, right=14)),\n", + " (Link(height=1671, left=8, right=20), Link(height=1670, left=8, right=20)),\n", + " (Link(height=1684, left=14, right=18), Link(height=1683, left=14, right=18)),\n", + " (Link(height=1717, left=0, right=17), Link(height=1716, left=0, right=17)),\n", + " (Link(height=1727, left=7, right=8), Link(height=1726, left=7, right=8)),\n", + " (Link(height=1866, left=8, right=16), Link(height=1865, left=8, right=16)),\n", + " (Link(height=1911, left=1, right=12), Link(height=1910, left=1, right=12)),\n", + " (Link(height=1966, left=20, right=23), Link(height=1965, left=20, right=23)),\n", + " (Link(height=1974, left=5, right=23), Link(height=1973, left=5, right=23)),\n", + " (Link(height=1994, left=18, right=19), Link(height=1993, left=18, right=19)),\n", + " (Link(height=2005, left=2, right=19), Link(height=2004, left=2, right=19)),\n", + " (Link(height=2031, left=12, right=17), Link(height=2030, left=12, right=17)),\n", + " (Link(height=2108, left=7, right=12), Link(height=2107, left=7, right=12)),\n", + " (Link(height=2137, left=7, right=16), Link(height=2136, left=7, right=16)),\n", + " (Link(height=2138, left=7, right=16), Link(height=2137, left=7, right=16)),\n", + " (Link(height=2229, left=10, right=11), Link(height=2228, left=10, right=11)),\n", + " (Link(height=2239, left=16, right=24), Link(height=2238, left=16, right=24)),\n", + " (Link(height=2240, left=16, right=24), Link(height=2239, left=16, right=24)),\n", + " (Link(height=2246, left=4, right=13), Link(height=2245, left=4, right=13)),\n", + " (Link(height=2247, left=4, right=13), Link(height=2246, left=4, right=13)),\n", + " (Link(height=2276, left=19, right=24), Link(height=2275, left=19, right=24)),\n", + " (Link(height=2277, left=4, right=18), Link(height=2276, left=4, right=18))]" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eliminable_pairs(pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10 loops, best of 3: 26.4 ms per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "eliminable_pairs(pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminable_pair(hgs):\n", + " for h in range(1, max(hgs.keys())):\n", + " for l in hgs[h]:\n", + " o = Link(l.height - 1, l.left, l.right)\n", + " if o in hgs[h-1]:\n", + " return l, o\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_pairs(net):\n", + " hgs = height_groups(pack(net))\n", + " eliminable_links = eliminable_pair(hgs)\n", + " while eliminable_links:\n", + " net = pack(l for l in net if l not in eliminable_links)\n", + " hgs = height_groups(pack(net))\n", + " eliminable_links = eliminable_pair(hgs)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "enet = eliminate_pairs(pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, net) == follow_many(string.ascii_lowercase, enet)\n", + "assert follow_many(string.ascii_lowercase, pnet) == follow_many(string.ascii_lowercase, enet)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 loop, best of 3: 2.37 s per loop\n" + ] + } + ], + "source": [ + "%%timeit\n", + "eliminate_pairs(pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def triple_pair(height_groups, debug=False):\n", + " ts = []\n", + " for h in range(3, max(height_groups.keys())):\n", + " for d in height_groups[h]:\n", + " if debug: print('d:', d)\n", + " ch = h - 1\n", + " cs = [l for l in height_groups[ch] if link_ends(l) & link_ends(d)]\n", + " if debug: print('cs:', cs)\n", + " while ch > 2 and not cs:\n", + " ch -= 1\n", + " cs = [l for l in height_groups[ch] if link_ends(l) & link_ends(d)]\n", + " if debug: print('cs:', cs)\n", + " if len(cs) == 1:\n", + " c = cs[0]\n", + " lines = set((d.left, d.right, c.left, c.right))\n", + " if debug: print('c:', '; lines:', lines)\n", + " bs = [l for l in height_groups[ch-1] if link_ends(l) & lines]\n", + " b = Link(ch - 1, d.left, d.right)\n", + " if debug: print('b:', b, '; bs:', bs)\n", + " if len(bs) == 1 and b in bs:\n", + " ah = b.height - 1\n", + " als = [l for l in height_groups[ah] if link_ends(l) & link_ends(c)]\n", + " if debug: print('ah:', ah, '; als:', als)\n", + " while ah > 0 and not als:\n", + " ah -= 1\n", + " als = [l for l in height_groups[ah] if link_ends(l) & link_ends(c)]\n", + " if debug: print('ah:', ah, '; als:', als)\n", + " a = Link(ah, c.left, c.right)\n", + " if debug: print('a:', a)\n", + " if a in als:\n", + " if debug: print('adding:', a, b, c, d)\n", + " ts += [(a, b, c, d)]\n", + " return ts" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_a_triple_pair(net, debug=False):\n", + " hgs = height_groups(net)\n", + "\n", + " tps = triple_pair(hgs)\n", + " if debug: print('eatp', tps)\n", + " if tps:\n", + " a, b, c, d = tps[0]\n", + " x = Link(b.height - 0.5, b.left, b.right)\n", + " y = Link(b.height, a.left, a.right)\n", + " if debug: print('removing', a, b, c, d, '; adding', x, y)\n", + " return pack([l for l in net if l not in [a, b, c, d]] + [x, y])\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[(Link(height=8, left=1, right=5),\n", + " Link(height=9, left=1, right=21),\n", + " Link(height=10, left=1, right=5),\n", + " Link(height=11, left=1, right=21)),\n", + " (Link(height=40, left=16, right=23),\n", + " Link(height=41, left=16, right=19),\n", + " Link(height=42, left=16, right=23),\n", + " Link(height=43, left=16, right=19)),\n", + " (Link(height=62, left=0, right=10),\n", + " Link(height=63, left=10, right=13),\n", + " Link(height=64, left=0, right=10),\n", + " Link(height=65, left=10, right=13)),\n", + " (Link(height=137, left=23, right=24),\n", + " Link(height=139, left=0, right=24),\n", + " Link(height=140, left=23, right=24),\n", + " Link(height=141, left=0, right=24)),\n", + " (Link(height=138, left=10, right=21),\n", + " Link(height=139, left=2, right=10),\n", + " Link(height=140, left=10, right=21),\n", + " Link(height=141, left=2, right=10)),\n", + " (Link(height=139, left=2, right=10),\n", + " Link(height=140, left=10, right=21),\n", + " Link(height=141, left=2, right=10),\n", + " Link(height=142, left=10, right=21)),\n", + " (Link(height=156, left=6, right=11),\n", + " Link(height=157, left=3, right=6),\n", + " Link(height=158, left=6, right=11),\n", + " Link(height=159, left=3, right=6)),\n", + " (Link(height=184, left=2, right=21),\n", + " Link(height=185, left=5, right=21),\n", + " Link(height=186, left=2, right=21),\n", + " Link(height=187, left=5, right=21)),\n", + " (Link(height=272, left=7, right=13),\n", + " Link(height=273, left=7, right=11),\n", + " Link(height=274, left=7, right=13),\n", + " Link(height=275, left=7, right=11)),\n", + " (Link(height=290, left=14, right=15),\n", + " Link(height=291, left=5, right=15),\n", + " Link(height=292, left=14, right=15),\n", + " Link(height=293, left=5, right=15)),\n", + " (Link(height=387, left=1, right=8),\n", + " Link(height=389, left=8, right=15),\n", + " Link(height=390, left=1, right=8),\n", + " Link(height=391, left=8, right=15)),\n", + " (Link(height=420, left=14, right=22),\n", + " Link(height=422, left=14, right=18),\n", + " Link(height=423, left=14, right=22),\n", + " Link(height=424, left=14, right=18)),\n", + " (Link(height=432, left=5, right=19),\n", + " Link(height=433, left=1, right=19),\n", + " Link(height=434, left=5, right=19),\n", + " Link(height=435, left=1, right=19)),\n", + " (Link(height=454, left=0, right=15),\n", + " Link(height=455, left=14, right=15),\n", + " Link(height=456, left=0, right=15),\n", + " Link(height=457, left=14, right=15)),\n", + " (Link(height=546, left=13, right=21),\n", + " Link(height=547, left=6, right=21),\n", + " Link(height=548, left=13, right=21),\n", + " Link(height=549, left=6, right=21)),\n", + " (Link(height=620, left=17, right=23),\n", + " Link(height=621, left=1, right=23),\n", + " Link(height=622, left=17, right=23),\n", + " Link(height=623, left=1, right=23)),\n", + " (Link(height=699, left=8, right=15),\n", + " Link(height=700, left=3, right=15),\n", + " Link(height=701, left=8, right=15),\n", + " Link(height=702, left=3, right=15)),\n", + " (Link(height=789, left=7, right=24),\n", + " Link(height=790, left=8, right=24),\n", + " Link(height=791, left=7, right=24),\n", + " Link(height=792, left=8, right=24)),\n", + " (Link(height=795, left=8, right=13),\n", + " Link(height=796, left=4, right=8),\n", + " Link(height=797, left=8, right=13),\n", + " Link(height=798, left=4, right=8)),\n", + " (Link(height=809, left=16, right=17),\n", + " Link(height=810, left=3, right=16),\n", + " Link(height=811, left=16, right=17),\n", + " Link(height=812, left=3, right=16)),\n", + " (Link(height=900, left=2, right=15),\n", + " Link(height=901, left=13, right=15),\n", + " Link(height=902, left=2, right=15),\n", + " Link(height=903, left=13, right=15)),\n", + " (Link(height=921, left=2, right=15),\n", + " Link(height=922, left=15, right=16),\n", + " Link(height=923, left=2, right=15),\n", + " Link(height=924, left=15, right=16)),\n", + " (Link(height=961, left=2, right=15),\n", + " Link(height=962, left=2, right=14),\n", + " Link(height=963, left=2, right=15),\n", + " Link(height=964, left=2, right=14)),\n", + " (Link(height=976, left=13, right=18),\n", + " Link(height=979, left=18, right=19),\n", + " Link(height=980, left=13, right=18),\n", + " Link(height=981, left=18, right=19)),\n", + " (Link(height=985, left=5, right=16),\n", + " Link(height=986, left=2, right=5),\n", + " Link(height=987, left=5, right=16),\n", + " Link(height=988, left=2, right=5)),\n", + " (Link(height=1050, left=9, right=24),\n", + " Link(height=1054, left=9, right=18),\n", + " Link(height=1055, left=9, right=24),\n", + " Link(height=1056, left=9, right=18)),\n", + " (Link(height=1159, left=11, right=21),\n", + " Link(height=1160, left=11, right=14),\n", + " Link(height=1161, left=11, right=21),\n", + " Link(height=1162, left=11, right=14)),\n", + " (Link(height=1284, left=0, right=11),\n", + " Link(height=1285, left=0, right=14),\n", + " Link(height=1286, left=0, right=11),\n", + " Link(height=1287, left=0, right=14)),\n", + " (Link(height=1331, left=4, right=9),\n", + " Link(height=1333, left=4, right=10),\n", + " Link(height=1334, left=4, right=9),\n", + " Link(height=1335, left=4, right=10)),\n", + " (Link(height=1332, left=12, right=18),\n", + " Link(height=1333, left=12, right=24),\n", + " Link(height=1334, left=12, right=18),\n", + " Link(height=1335, left=12, right=24)),\n", + " (Link(height=1343, left=0, right=17),\n", + " Link(height=1344, left=0, right=23),\n", + " Link(height=1345, left=0, right=17),\n", + " Link(height=1346, left=0, right=23)),\n", + " (Link(height=1357, left=4, right=16),\n", + " Link(height=1358, left=16, right=17),\n", + " Link(height=1359, left=4, right=16),\n", + " Link(height=1360, left=16, right=17)),\n", + " (Link(height=1441, left=6, right=20),\n", + " Link(height=1443, left=16, right=20),\n", + " Link(height=1444, left=6, right=20),\n", + " Link(height=1445, left=16, right=20)),\n", + " (Link(height=1464, left=17, right=23),\n", + " Link(height=1465, left=3, right=17),\n", + " Link(height=1466, left=17, right=23),\n", + " Link(height=1467, left=3, right=17)),\n", + " (Link(height=1540, left=8, right=23),\n", + " Link(height=1541, left=7, right=23),\n", + " Link(height=1542, left=8, right=23),\n", + " Link(height=1543, left=7, right=23)),\n", + " (Link(height=1570, left=0, right=1),\n", + " Link(height=1571, left=1, right=21),\n", + " Link(height=1572, left=0, right=1),\n", + " Link(height=1573, left=1, right=21)),\n", + " (Link(height=1600, left=15, right=22),\n", + " Link(height=1603, left=7, right=15),\n", + " Link(height=1604, left=15, right=22),\n", + " Link(height=1605, left=7, right=15)),\n", + " (Link(height=1632, left=12, right=18),\n", + " Link(height=1634, left=12, right=20),\n", + " Link(height=1635, left=12, right=18),\n", + " Link(height=1636, left=12, right=20)),\n", + " (Link(height=1702, left=13, right=24),\n", + " Link(height=1705, left=14, right=24),\n", + " Link(height=1706, left=13, right=24),\n", + " Link(height=1707, left=14, right=24)),\n", + " (Link(height=1721, left=3, right=24),\n", + " Link(height=1722, left=3, right=21),\n", + " Link(height=1723, left=3, right=24),\n", + " Link(height=1724, left=3, right=21)),\n", + " (Link(height=1722, left=3, right=21),\n", + " Link(height=1723, left=3, right=24),\n", + " Link(height=1724, left=3, right=21),\n", + " Link(height=1725, left=3, right=24)),\n", + " (Link(height=1762, left=0, right=21),\n", + " Link(height=1763, left=13, right=21),\n", + " Link(height=1764, left=0, right=21),\n", + " Link(height=1765, left=13, right=21)),\n", + " (Link(height=1769, left=7, right=9),\n", + " Link(height=1770, left=7, right=12),\n", + " Link(height=1771, left=7, right=9),\n", + " Link(height=1772, left=7, right=12)),\n", + " (Link(height=1914, left=10, right=24),\n", + " Link(height=1915, left=8, right=24),\n", + " Link(height=1916, left=10, right=24),\n", + " Link(height=1917, left=8, right=24)),\n", + " (Link(height=1920, left=4, right=23),\n", + " Link(height=1921, left=3, right=4),\n", + " Link(height=1922, left=4, right=23),\n", + " Link(height=1923, left=3, right=4)),\n", + " (Link(height=2023, left=4, right=7),\n", + " Link(height=2024, left=7, right=15),\n", + " Link(height=2025, left=4, right=7),\n", + " Link(height=2026, left=7, right=15)),\n", + " (Link(height=2025, left=8, right=19),\n", + " Link(height=2031, left=8, right=15),\n", + " Link(height=2032, left=8, right=19),\n", + " Link(height=2033, left=8, right=15)),\n", + " (Link(height=2152, left=10, right=15),\n", + " Link(height=2153, left=10, right=16),\n", + " Link(height=2154, left=10, right=15),\n", + " Link(height=2155, left=10, right=16)),\n", + " (Link(height=2194, left=22, right=24),\n", + " Link(height=2195, left=7, right=22),\n", + " Link(height=2196, left=22, right=24),\n", + " Link(height=2197, left=7, right=22)),\n", + " (Link(height=2211, left=5, right=6),\n", + " Link(height=2212, left=6, right=14),\n", + " Link(height=2213, left=5, right=6),\n", + " Link(height=2214, left=6, right=14))]" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "hgs = height_groups(enet)\n", + "triple_pair(hgs)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "etnet = eliminate_a_triple_pair(enet)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, etnet) == follow_many(string.ascii_lowercase, enet)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def eliminate_triple_pairs(net):\n", + " print(len(net))\n", + " new_net = eliminate_a_triple_pair(net)\n", + " while new_net:\n", + " print(len(net))\n", + " net = new_net\n", + " new_net = eliminate_a_triple_pair(net)\n", + " return net" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10033\n", + "10033\n", + "10031\n", + "10029\n", + "10027\n", + "10025\n", + "10023\n", + "10021\n", + "10019\n", + "10017\n", + "10015\n", + "10013\n", + "10011\n", + "10009\n", + "10007\n", + "10005\n", + "10003\n", + "10001\n", + "9999\n", + "9997\n", + "9995\n", + "9993\n", + "9991\n", + "9989\n", + "9987\n", + "9985\n", + "9983\n", + "9981\n", + "9979\n", + "9977\n", + "9975\n", + "9973\n", + "9971\n", + "9969\n", + "9967\n", + "9965\n", + "9963\n", + "9961\n", + "9959\n", + "9957\n", + "9955\n", + "9953\n", + "9951\n", + "9949\n", + "9947\n", + "9945\n", + "9943\n", + "9941\n", + "9939\n" + ] + } + ], + "source": [ + "setnet = eliminate_triple_pairs(enet)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9937" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(setnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "assert follow_many(string.ascii_lowercase, etnet) == follow_many(string.ascii_lowercase, enet)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, etnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, setnet))" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, enet))" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, net))" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eliminable_pairs(etnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(10135, 10031)" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(net), len(etnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def simplify(net0):\n", + " netp = eliminate_pairs(net0)\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " while new_net:\n", + "# print('sipl', len(net0), len(netp), len(new_net))\n", + " netp = eliminate_pairs(new_net)\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " return netp" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "simple_net = simplify(pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, simple_net)) == ''.join(follow_many(string.ascii_lowercase, net))" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, simple_net))" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'doqzmbishkwunvltpcexyjgfra'" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, net))" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9931" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(simple_net)" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def simplify_with_checks(net0):\n", + " netp = eliminate_pairs(net0)\n", + " if follow_many(string.ascii_lowercase, net0) != follow_many(string.ascii_lowercase, netp):\n", + " print('pairs', eliminable_pairs(net0))\n", + " return net0\n", + " else:\n", + " print('pairs ok')\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " if new_net and follow_many(string.ascii_lowercase, new_net) != follow_many(string.ascii_lowercase, netp):\n", + " hg = find_height_groups(netp)\n", + " print('triple', triple_pair_hg(hg))\n", + " return netp\n", + " else:\n", + " print('triple ok')\n", + " while new_net:\n", + "# print('sipl', len(net0), len(netp), len(new_net))\n", + " netp = eliminate_pairs(new_net)\n", + " if follow_many(string.ascii_lowercase, new_net) != follow_many(string.ascii_lowercase, netp):\n", + " print('pairs', eliminable_pairs(new_net))\n", + " return new_net\n", + " else:\n", + " print('pairs ok')\n", + " new_net = eliminate_a_triple_pair(netp)\n", + " if new_net and follow_many(string.ascii_lowercase, new_net) != follow_many(string.ascii_lowercase, netp):\n", + " hg = find_height_groups(netp)\n", + " print('triple', triple_pair_hg(hg))\n", + " return netp\n", + " else:\n", + " print('triple ok')\n", + " print('** done')\n", + " return netp" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "pairs ok\n", + "triple ok\n", + "** done\n" + ] + } + ], + "source": [ + "spnet = simplify_with_checks(pnet)" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(follow_many(string.ascii_lowercase, spnet)) == ''.join(follow_many(string.ascii_lowercase, net))" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "9931" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(spnet)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/07-interpreter/machine-code.ipynb b/07-interpreter/machine-code.ipynb index 7d3d6a6..48da543 100644 --- a/07-interpreter/machine-code.ipynb +++ b/07-interpreter/machine-code.ipynb @@ -34,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 1, "metadata": { "collapsed": true }, @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -64,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 3, "metadata": { "collapsed": true }, @@ -77,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 4, "metadata": { "collapsed": true }, @@ -90,7 +90,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 5, "metadata": { "collapsed": true }, @@ -102,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 6, "metadata": { "collapsed": true }, @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 7, "metadata": { "collapsed": true }, @@ -130,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 8, "metadata": { "collapsed": true }, @@ -143,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 9, "metadata": { "collapsed": true }, @@ -156,7 +156,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 10, "metadata": { "collapsed": true }, @@ -172,7 +172,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 11, "metadata": { "collapsed": true }, @@ -186,7 +186,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 12, "metadata": { "collapsed": true }, @@ -204,7 +204,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -213,7 +213,7 @@ "{'a': 2, 'b': 1, 'c': 0, 'instructions': [], 'pc': 3}" ] }, - "execution_count": 34, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -229,7 +229,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 14, "metadata": { "collapsed": true }, @@ -241,21 +241,23 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 42, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def program_from_listing(listing, machine):\n", - " labelled_instructions = [i for i in listing.split('\\n') if i]\n", + " labelled_instructions = [i.strip() for i in listing.split('\\n') \n", + " if i.strip() \n", + " if not i.strip().startswith('#')]\n", " instructions = replace_labels(labelled_instructions)\n", " program_from_instructions(instructions, machine)" ] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 39, "metadata": { "collapsed": true }, @@ -288,7 +290,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -297,7 +299,7 @@ "['inc', 'a']" ] }, - "execution_count": 38, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -308,37 +310,41 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 40, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "['set a 10', 'dec a', 'inc b', 'sto b 1', 'jpz a 2', 'jmp -4']" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "set a 10\n", + "dec a\n", + "inc b\n", + "sto b 1\n", + "jpz a 2\n", + "jmp -4\n" + ] } ], "source": [ "program = \"\"\"\n", " set a 10\n", + " # comment line\n", + " \n", "loop: dec a\n", " inc b\n", " sto b 1\n", " jpz a 2\n", " jmp loop\n", "\"\"\"\n", - "labelled_instructions = [i for i in program.split('\\n') if i]\n", + "labelled_instructions = [i.strip() for i in program.split('\\n') if i.strip() if not i.strip().startswith('#')]\n", "instructions = replace_labels(labelled_instructions)\n", - "instructions" + "print('\\n'.join(instructions))" ] }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 19, "metadata": { "collapsed": true }, @@ -356,7 +362,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 20, "metadata": { "collapsed": true }, @@ -371,7 +377,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -387,7 +393,7 @@ " 'pc': 4}" ] }, - "execution_count": 42, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -404,26 +410,26 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'b': 10,\n", - " 1: 10,\n", - " 'instructions': [(, ['a', 10]),\n", + "{'instructions': [(, ['a', 10]),\n", " (, ['a']),\n", " (, ['b']),\n", " (, ['b', 1]),\n", " (, ['a', 2]),\n", " (, [-4])],\n", - " 'pc': 6,\n", + " 1: 10,\n", + " 'c': 20,\n", " 'a': 0,\n", - " 'c': 20}" + " 'pc': 6,\n", + " 'b': 10}" ] }, - "execution_count": 43, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -445,26 +451,26 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'b': 10,\n", - " 1: 10,\n", - " 'instructions': [(, ['a', 10]),\n", + "{'instructions': [(, ['a', 10]),\n", " (, ['a']),\n", " (, ['b']),\n", " (, ['b', 1]),\n", " (, ['a', 2]),\n", " (, [-4])],\n", - " 'pc': 6,\n", + " 1: 10,\n", + " 'c': 20,\n", " 'a': 0,\n", - " 'c': 20}" + " 'pc': 6,\n", + " 'b': 10}" ] }, - "execution_count": 44, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -483,7 +489,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -504,7 +510,7 @@ " 'pc': 10}" ] }, - "execution_count": 45, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -529,7 +535,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -550,7 +556,7 @@ " 'pc': 9}" ] }, - "execution_count": 49, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -576,16 +582,16 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'10: 7, a: 0, b: 1, c: 3, pc: 11'" + "'1: 8, a: 0, b: 1, c: 8, pc: 11'" ] }, - "execution_count": 52, + "execution_count": 85, "metadata": {}, "output_type": "execute_result" } @@ -593,7 +599,6 @@ "source": [ "# c holds floor(a/2)\n", "program = \"\"\"\n", - " sto a 10\n", " set c 0\n", " set b 0\n", "loop: dec a\n", @@ -604,6 +609,166 @@ "odd: inc b\n", "end: jpz a 2\n", " jmp loop\n", + " sto c 1\n", + "\"\"\"\n", + "# m = new_machine()\n", + "# program_from_listing(program, m)\n", + "# run(m)\n", + "show_machine(execute(program, initial_state={'a': 17}))" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'a: 4, b: 0, c: 12, pc: 9'" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# c holds a * 3\n", + "program = \"\"\"\n", + " set c 0\n", + " cpy a b\n", + " # start of main loop\n", + "loop: jpz b end\n", + " dec b\n", + " inc c\n", + " inc c\n", + " inc c\n", + " jmp loop\n", + " \n", + " # end of program \n", + " \n", + "end: jmp 1\n", + "\"\"\"\n", + "# m = new_machine()\n", + "# program_from_listing(program, m)\n", + "# run(m)\n", + "show_machine(execute(program, initial_state={'a': 4}))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# c holds a!\n", + "program = \"\"\"\n", + "??????????????\n", + " set c 0\n", + " cpy a b\n", + " # start of main loop\n", + "loop: jpz b end\n", + " dec b\n", + " inc c\n", + " inc c\n", + " inc c\n", + " jmp loop\n", + " \n", + " # end of program \n", + " \n", + "end: jmp 1\n", + "\"\"\"\n", + "# m = new_machine()\n", + "# program_from_listing(program, m)\n", + "# run(m)\n", + "show_machine(execute(program, initial_state={'a': 4}))" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'1: 52, a: 0, b: 0, c: 0, pc: 46'" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Collatz. a initially holds value, but location 1 is used to store the current value as we're going along.\n", + "# Location 2 holds number of steps taken\n", + "# Location 3 holds max value reached\n", + "program = \"\"\"\n", + " sto a 1\n", + " \n", + " set b 0\n", + " \n", + " # if a is one, finish, \n", + "main: dec a\n", + " jpz a end\n", + " inc a\n", + " \n", + " # find parity of a\n", + " cpy a c\n", + " set b 0\n", + "prty: dec c\n", + " jpz b odd\n", + " dec b\n", + " jmp prte\n", + "odd: inc b\n", + "prte: jpz c 2\n", + " jmp prty\n", + " \n", + " # b == 0 means a even; b == 1 means a odd\n", + " jpz b isev\n", + "\n", + " # c holds a * 3 + 1\n", + " cpy a b\n", + "mul: jpz b emul\n", + " dec b\n", + " inc c\n", + " inc c\n", + " inc c\n", + " jmp mul\n", + "emul: inc c\n", + " cpy c a\n", + " jmp fin\n", + " \n", + " \n", + "isev: set c 0\n", + " set b 0\n", + "hlvl: dec a\n", + " jpz b oddh\n", + " dec b\n", + " inc c\n", + " jmp endh\n", + "oddh: inc b\n", + "endh: jpz a 2\n", + " jmp hlvl\n", + " cpy c a\n", + "\n", + "fin: cpy a b\n", + " ld c 1\n", + "maxc: jpz c this\n", + " jpz b othr\n", + " dec b\n", + " dec c\n", + " jmp maxc\n", + "this: sto a 1\n", + "othr: jmp main\n", + " \n", + " # end of program \n", + " \n", + "end: set c 0\n", "\"\"\"\n", "# m = new_machine()\n", "# program_from_listing(program, m)\n", @@ -611,6 +776,133 @@ "show_machine(execute(program, initial_state={'a': 7}))" ] }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "40" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "13*3+1" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def max_collatz(start):\n", + " mc = start\n", + " i = start\n", + " while i != 1:\n", + " if i % 2 == 0:\n", + " i = i // 2\n", + " else:\n", + " i = 3 * i + 1\n", + " if i > mc:\n", + " mc = i\n", + " return mc" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "52" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max_collatz(7)" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(250504, 937)" + ] + }, + "execution_count": 80, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max([(max_collatz(i), i) for i in range(1, 1000)])" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ans = []\n", + "for i in range(1, 100):\n", + " m = execute(program, initial_state={'a': i})\n", + " c = max_collatz(i)\n", + " if m[1] != c:\n", + " ans += [(i, m[1], c)]\n", + "ans" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'1: 250504, a: 0, b: 0, c: 0, pc: 46'" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show_machine(execute(program, initial_state={'a': 937}))" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/04-word-search/04-wordsearch.txt b/10-word-search/10-wordsearch.txt similarity index 70% rename from 04-word-search/04-wordsearch.txt rename to 10-word-search/10-wordsearch.txt index f5a13ab..0bfe777 100644 --- a/04-word-search/04-wordsearch.txt +++ b/10-word-search/10-wordsearch.txt @@ -99,744 +99,705 @@ trxrmgmsinimefestaniridihueiokfkdedutingamsnoynacqndecayswceagdoarakagcelniesvsn sgeosdrenblurbscaldahomnnoncncimonoxatkineticrseqorhnarksokurlsqplrreteaiheeeerepwrylykpdtubesuerogi qmsaesuohdraugzuiecvemsgigtycnangiopatawdrieroawjsonscallopedsesiwpratstclfddoiastelfaelihbumblersru itekrandomisessvrraayrgripestsivitcellocsbawsshapeliestmjgnitontoofhylluftsaobwsocilacidlocatedlrsee -aberrant -aberrant -aboriginals +abetter +abeyance +abloom +abolitionists +abominate abound -absently +abroad +abscond +abstaining abstracted +abstracting +academic accidents -accountability -accreditation -achieve -acidly -acrostic -actionable +accurateness +acidifies activist +acupuncturists acute adapter +adaptors addle adjective -adjourned adjudges adjurations adjuring +admirals +admission +admonitions +adobes +adorning adorns -adulterating -aerial -aerodynamics -aesthetics -aflame +adventuresome +advocated afternoons agates aggregate -aggrieving agings agrarians aimed +airdropped airlines -airmailed -alderman align alive +allegedly allergy allusive +aloes +aloha along -aloof -alternate +alphabetically +alterable alumni -amalgamate +amassing ambiguously -ambition -ambles +amending amends +amenity amity amongst -amorously +amplify ampule -analgesia -angular -anions +anatomical +anesthetize +annexing antennae antimatter -antipastos -antiperspirants -antiseptic antitoxins aplenty -applications -appropriated -approximate +apparent +appealing +applaud +aquanaut arcade -archdeacon -argosy +arduousness aristocrat +arithmetically armed armful +armorers +arose around +arrogance +articulating +artistically ascetic aspiring +assessor asset assumed assurance atelier -atheist -atrophies -attenuation attire -auction -audacious -augustest -automates +auditoriums +auguster +autobiographical +autographing +autoworkers availability avenger +aviary avidly awaits -awarding awkwardest -babbles -babies +backbone +backfire backhand backslide -backtracked bacterium bagel balanced +balances baldest -balling balmy balsa banister -banjoes +banking banks +banshees barbed -barbeques +barbered bards -bareback barge baring +barker barley -barrister baselines -baseness basil -basting bathe batter baulk -bawling beatify bedfellows +bedraggling +bedroom +beehive +beepers beetles -befogs begot +behest +belayed belches -belief -belladonna bells -bemoaned bench -benchmarks -benefitted -bereavements bereft +beryllium +besides +besotted bestrid -bestride -betaken -bethinks -bewitches biased biassing -bicycles -biennials bight -billowing bimbo binging biopsy -biotechnology birdie -birthright -bisexual -bitingly -blackguards +bitchy +blamelessly blanched -blankest -blasphemes +blanches +blandly +blanketed bleeder -blithely -bloods +blockades +bloodier +blouses blown -blundering blurb blurt +blushed boards +boardwalks boastfully -boatswain bodies -bodkins boilers -bombardment bongo -bookkeeper boorishly booties -bordered bossy botches -bothers -bottles -bottomless boughs +bouquet bowels braggers +braiding brasher bravery break -breaststrokes breathy -breech breeding brier brigands +brightness brink brisket -broncho +broilers +brokering +brontosaurus brooms brought -brownest bruise +brunettes +brusquest +brutalises bucket buckskins bucolic budging -buggers -bulks -bulldozer +bulges +bulldogging +bullish bully bumblers +bumps +bundling bunglers -bungles +burbled burrows +burrs bursitis -busily -busybodies +bushmen +bustling butterfingers butternuts buttocks +buzzards +bylines bywords cabals cactus -cadavers cadge -caftan caged caked +calabash calcium calicos callously -calms -cameraman +canards cancelled -candidacy +cancelling canine -canister +cannoning cannot canoes +cantors canyons -capitalise +captaincies caramel +caravan +carbides +carbonating +carcinogenic +cardigan caressed cargoes carousel carouser +carpels cascading +cassava +cassocks caster -castigate castigator -catalogued +casualties catapult -catcall +catchings caudal +causing +caustically +cavernous +celebratory cellist -certifications chaffed -chainsaws +chairman chairwomen chaise chance -chancels chanty chapped chaps -charge +charismatics chars -chastisements -chauvinism -cheaper +chasten cheaters cheers +cheesed cheques chiefs chiffon -chimaera -chime +childishness +chiropractics chirp -choir +choose chopping chores christen chromes +chromosome chronometer +chummier +cinchona +circumflex +cirrhosis cistern citadels -civet +citron +civilian civilises -clacks -clamours -clapped -clarified -classier classrooms +clause +clavicles claws cleanse -clearinghouse -clicked -climaxing -clincher -clinging -clocking -clocks -clung +clockworks clutch -coalesced coaster coccus -codding +cocooning codifies coevals -coexisted -coldest +coiffuring +colitis collar +collections collectivists -colonialist -colors +collieries +colonial comatose combats -commandeered +comeuppance commas -commend -commentator +communist +communities +compaction complains -completing -complimenting -compromise +complication +compulsory +compute conceal -concertinaed -conciliated +conceived +conceptions +concertmasters concluding concordant -concourse concrete -condemns +condoes condor +conferment +confession confide configuration -confining -confront congaed -congesting -congregates -conjunctive +congeals +conglomerate +congratulatory +conjure connection conniver conscience -consortia -constellation -constructing -contaminate -contested +consorts +contests contrasted +contrives controllable -contumacious contuses +conversational conversions -convicts convinces -cooper +coons +cooperates +coppice copulate -copyrighted cords -corked corms corpse +corrupts costars costliest cotyledon +counterbalance +counterexample +countersinking coupled coupon -courtships -coves -covets -cowbirds -crafty -cranial -crated +coverage +crackerjack crater -crayfishes +crawlspaces +crayon crazy -credenza +credulity creeks cremate -crewed +crewman crier +crinolines crispier croak -croupy +crosier cruet +crushing cubic culling +culminate +cultivates cupola +curates curdles curdling -curfews curiosity curler -custard +custodial customers -cutesiest -cutoffs cycled +cylindrical dabbed -daguerreotype daiquiri daisy -dallying +damaged damming +damping damps -dandies dandled -dangling dapperest darns -dazed +dauphin +dawdlers +dawned deacon -deadpanning dears deathblow -deaths +deaves debarks -debauches decamping decay +decently +decentralises decentralising -decoded +deceptiveness +decommissioning +decompressed +decontamination decree deduces -deductibles -deeming -defecation -defender -deformity -delayed +deducted +defend +deference +deficient +deflector +dehumanising +delight delis -deludes demagnetises +demitasses +demographics +demonstrated denotes dentures -denying +departure dependence dependent -deploys +depopulates +depopulation deposit -deposition deputy -desecrate -desensitised +derivation +describing +descries deserted -despot -detect +desiderata +designed +despises +destines detox -deviated +deviants devised devolved devotees -devour -devours -dictated +diagnostic +dicks dictatorial -differently -diffusing -dimensional -diminuendo +diffidence +dimmers dinned -direst -dirtying +directs disable -disassociating +disagree disavows discolor -disconnecting -discontentedly -discontents discrimination -discursive -discusses -disgruntled -dishonor -disillusioning -disinherit +disease +disestablished +dishonour +diskette dismal dismay -disowns -disparages disparaging -displays -displease -disported -dispossessed -disprove -disrobing -dissimulates +disreputably +dissenters +distortion distrusts +dived divesting -divulged +divests +dividends divvied dogged dogies dogtrot dogwoods dominant +donations dosed -dosing doted -douche -downstage -dowsed +doughtiest +doves draft -drape -drawn +drank +drastically drenches -driblet drifter +drink drivel drollery dross drowsy +dryad duding dulls dusts dynamic -dynamism eager eardrum -earnings eastern echelons -editorial -educates -effusion -egalitarians -egotist -eighteenths -electrifies +ecstatically +eighteens electrify -electrolyte -elevated elides -elsewhere +ellipse elucidated -embarrassingly +emailed embed -embezzle emery +emote +empathised empty -enabled enabling +encamping encrusts endless endow -enemy -enervating +endurable +energised engagement -engineers engorged -enjoyable -enlists +enlightening enquired enrapture -entertains -entreat -entreaties -epaulette -epiglottises -epitaphs +enrichment +entertainers +enveloping epoxies equability -equivocated -eradicating +error erupting escape estranged -evacuates +eternity +evacuees evades evict evidenced -examiners +evidences excavations -exceptionable -excruciatingly -excursion -executing -executives -exertions +excommunicating +exhibitor +existential exited -expectorant +exorcisms expectorates +expediencies expend -expense +experiment expire explicated -exploitative +exploitation +exponentiation expostulates -expressive -extemporised -extincted extort -extraction extraditions -eyetooth +exultant +exulting +eyeball fabled fabricates facades -facet facilitate facts faeces fagots -fainted fairies -faithless falsest -falsifying falsity +fanned fanny -fasten -faulted +farther faunas -favored fazes fealty feared feedings -feinting +feels +fellowships feminism -fettle +fences feverishly fewest fiery -fiestas +filberts finals -finch finis -finked -firewalls -firsthand -fitted +fishtailing +fixatives +fixedly fixers +fixtures flaps flashed flashers -flattery +flautist fleeced fleshy flier +flightless flinching -flings -flippest -floating +floozy +flopping florae -flour -fluidly fluke -flummox -fluxing +fluoresced +fluoridated foams foamy -fogeys folds -foolishness +foothold footnoting footwear -foppish -forbearing fords forebodes -forefront -foreordained +forecasting fores +foretasted forge -forgetful +formalise +formulation +fortissimo +fossilised fouler -fountainheads -fractures -frankfurter -fraternises fraud freaky -freeman -freestyles -freighter +fretted friar +fridges fried -friends -friendship fries frigid -frillier -frills -frippery frolics frosty frowsy -frugality -fruiting fruits fryer fucker fuddled -fulminated -fumbled +functioned funnel funner -funniness -furious furriest fused -gabardines -gadabout gages -galleons gallivants +gallstone gambol -gamete -gamines +ganglion gaping -gardens -garnet +garish garoted garret -gashing +garrote +garrotted gasket +gateway gawkiest gawkily +gazebo gecko -genome +genies +genocide genre gentle -gentled -geographers -getup gewgaw gibber gifting @@ -845,369 +806,401 @@ gimme gingersnap gingivitis girdle -girds gladdened glade -glades glamors glances +glassware +glassy glider -glitches +globules glues glyph +gnarly goals goblets +godchild golfs gonna -gopher +governesses grace graded +grandmas +grandmother +granular gratefully -gravestone -great +grayer +greatness +greenest greenish -greenness +greyed greyish +grilles griming grimy grinder grinned gripes +groans +grooves grovels growling growls grubbing gruesomer -grumpier +gruffly guardhouse guess guild +guillotined guiltier gummy gunfire guying gybes -haggle +habitat +haemorrhoids +haggled hairdo -hairstylists -halfpence -haloed +haled halves -handbooks -handcar -handiest -handmaiden +hampered handspring hankering happen -harem +hardback +hardened +hardens harken -harming +harping hasps hatch havoc -headhunter +haycocks headmistress -headway heady heaps -hearsay hearses +heartthrob heaving +hefty height -heliotropes -hellhole -helmets -hereabout -heroins -hideouts +heliports +helpers +helplessness +hemlock +hennaed +heroics +highlighting hikers hills -hinterland +hirsute hisses +historian hitch -hitches -hoarseness hobnobs hokiest -holiday -homegrown +holder +holdings +holstering homesteading +hometown +homogeneous honester -honking +honeycombing hooks -hopscotches -horns -horseshoeing horsetail -hospital -hugest +horticulturist +hottest +housemothers hugged -humanity -humbleness humbler +humidifiers hunch -hydroponics -hying +hunted +hurrayed +hybridising +hydrae +hydrogenates +hyenas hymens hyped hypersensitivities -hypertext +hypocritically hypos +hypothermia iambs icing -identified +ideology idlers +ignominies +ignominy ikons illicit +illuminated +imitate immediacy -immerses -immobile +immigration impalas -implementing -imprecations -impregnable -impresarios -impresarios +impeach +impending +impersonates +implementation +importunity impulse incises -incubus -indigents -industrialised +inclement +inclosure +incrusting +indiscriminate +inductees +inefficiencies inertia infests -infinitesimally -informational -infractions +infighting +inflects +inflorescence infringements -infusion inhere inheritance -inimitable +injunctions +innate +innocent +inoculating input -inseam +inquisitors insight +insinuates insists +insolent instalment -institution -insufficiency -insulation insulted +intaglio intent -intercede -intercepts -interconnect +intercourse interference -interfering -interlinking -intermarries +interlinked interpolated interpose +interventions intones +intruders +intuition +inundated inveighing invent -inventors inverses -irons +inverting +inveterate +inviolate +invitingly irradiates -irreparably -irrevocable isotropic -itched +itemisation jabbed +jackhammer jaguar japans +jaywalk jeeps jellying jewelry jibbing jibed -jinnis +jitterbug jiving jobbing jokes +joking +jollying jolted -jovially +journeyman joyrode -junket -juntas -juvenile +jugged +juleps +justifications +kaleidoscopes +kazoo keepsakes kennelled +kernel +kestrel keynotes khaki -khakis kilobytes kinder kindles kinetic +kissed +kittens kitty +klutzes +kneed kneel knifed -knits knitting -knuckles -koshered +knobs +known kowtowed krone -laborious laced -ladling laity +lamentably +lamps +lancet landmark -lapidaries lather latrine latticework -laughingstock laughter -lavisher +lavishness lawfulness +laxness laymen lazes lazied lazies leaflets +leapfrogging leaves +ledger +leeks +lemma +leprosy lessors letter levee libel liefest lifeline +lightning likes limbo limed limestone limit -limping liner +lingos +liqueur lithography -liveries -llanos -loath +litter +loaning lobby located lockets -loftiest lollipops longish -loony +looking +looney +lorgnettes lotto -loveliness loves +lowbrows lurked lusted +lyceums lyrical mackintosh magisterial +magnesium magnitude -magnolias +mailbox mails -mainlined -makeups -malarial +mainsprings mammas -mandrill -manifestoes -marchers +manning +mantra mares -markedly +marketer +markups +maroon martinis martins -masques -masterpieces +masonic +massacred +mastiffs matchbox -maternally -mathematically -matrons -mausoleum +matchstick +matriarch +mauls +mawkish maximal -mayhem -meadowlark +mayoralty mealy medias -mediator -medicated +mediocrities meekly mellowest -melodically melon -mental -mentioned -meringues +menstruated +mentor merinos +mermaid +mermen +messenger messiahs -metacarpus -metastasis +metamorphosis +metastases meteorological methodologies -metres -midriffs -miked +metrication +mettlesome +mewled +micron mikes +mildness miller mills mined +minestrone minicam -minuends mirror mirth misadventure -mischief +misanthropic +misdirected +misers misgivings -misinforms +misgoverning +misjudgement misread missile missives mister -mistime +mistyping mitre +mitring mitten mixer -mocks modal moiety moister -moisturising -molasses moleskin -molested -monarchic +momentous +monarchist monetarily -monopolised -monthlies -mooning mooted moppets morbid mornings morsel -mortgage +mortar +mortify motels -mothballing -motherboard -motionless motorcars -moused +motorcycling +motorists +moulded mouths -movable movers muffling -mullahs -multiplexers -multiplexes -mummers -muralists -musicians +muscatels musings -mussel -mussiest mutate myopia +mythological nagged naively -nakedly nanny napalming narks @@ -1216,161 +1209,173 @@ nasal nationalising naturalised nearby -neglect +negotiate nerds -nestle +neuralgia neutrals -newsletters nicking nicotine -niece -nightmare -noddy +ninetieths +noggins noisily nominees +noncommittal +nonconductor +nondescript nonhuman -nonplused +nonviolent nosegays +nosing notably notified noughts novelties -nuncio +numerated nurse nurture nutmegs +nuzzling oasis +obelisks obeyed obeys +obfuscating object -obliges obscured -obscures -obsequiousness -obsequy -occupation +obsess +obsolescence oceans +octagons octal +octogenarians oddest +offended +offensiveness +officiously okayed -onomatopoeia -onsets +omnibus opaques -operation +openers opinion -oppressor +oppresses +opprobrium +optional orals orated -orations +organised oriented +originating ornery -osteopaths -ostracism -ouster -outcomes -outdistances +ospreys +outcropped outlasted -outlaws +outmanoeuvred outputted -outrageously outsmarted outvoted -overcrowded +overachieve +overeating +overestimating overlain -overland -overnights -overrules +overlies +overpopulate +overrule overtakes overturns overwhelmed owned oxbows -oxygenates +oxide oyster padded paging pained -paled pales palliate palsy +panhandlers panic panier -pantaloons panted -parallels +panther parameter +parapets +parboil parental +parkas parked parsley partner -passions -pasting -patina +pastier +pasturage +patchier patriarchies +paused pauses pawned +pawning pawpaw -paymasters peacock -pearlier peccary -pecked -peculiarities peddle -pediments pedometer peewee -pelagic pellagra pencil penning -peppery -percussionist +peopled +perfumeries +peripatetic +perishing +perkiness permissions perpetuating -perspiration perusals -petiole +peseta +petticoat phallic -philander -phoneying +phantasms +philistine +phosphorescent physicking physics -pianos -piazza piazze +pickaback picks piece pigskin pilaf piling -piloting pimply pineapple pinhole pining -pinned pinup -piton +pitch +pivots pizazz placarding +placing placket +plaice +plainclothesman plane planked plaque +plastic plateful -players -plexuses +platter plighted -ploddings plopped +ploughed plowman -plummeting +plowmen +plowshares +plugins plunge -plusher pocketbook poesy +poetesses poetical poignancy point @@ -1378,724 +1383,719 @@ poised poked pokey pollen -poltergeists +pollsters +poltergeist poltroons +polygraphing polyp +pones +ponytail poplin -popularising -popularity -pornographers +poppy portico portraying postage -postcard -potion potter pounce -pounding practices practised pragmatic prance -prancer prawning prearrange precautionary -preceding -preceptor -precipice -preps +precipitately +predatory +prefigures +preoccupies +prerecord presage +preternatural +prevaricate price -priests primes +print +procrastinators +procreated prodding professor -profitably -prohibitionists +programed prohibitively -promulgating -pronged +promote +pronouncement +proof propane propellers proper -properties proponents proposals -propulsion -protestors -protrusion +proposes +prosecution +prospered +prostituted proves prowl -prudery psalmist +psychotic +puckering pukes puking pullbacks pumice pumped -punchiest -purebreds -purulence -puzzles -qualifier +purely +pursuer +pushovers +pyramiding +quads +quality quarantining -quartette quash querying +quicken quieter quiets -quirkier +quietude quoit rabbinate raceway -racism radial radiant rafts ragamuffin raged +railed raiment raincoat -rajahs raked -rambunctiousness +ramification ramming randomises -rapids +ransomed raptures rasps ratchet ratified -ravel +rationalistic +ratios +rattier raves -ravings -rawer razed razzes reads +reaffirms realise realising +rebuked rebut receive -recliner -recompenses -reconnected -reconnoiters -recreation rectifications recuperate -redirected +recuperation +redeem +rediscovered redistricts redoing -redundant +redrawn reedy reefs -reforests -refuels +reeving regale regally +regenerated regularly -rehabbed -rehearsed +regurgitate reigns -reimbursed reindeers reinterpreting -reinvents -reissues -reiterates relabel relates -remake +relays +remembered +remission remunerated renal rending rends +renounce rents -reoccur reopened -repackage -repatriate repeal -repealed reprobates -reproduce -reproducing -rereads resells resemble -resistance -resolved resonant +resourced +respectably +respire +respond +restating +restored retail -retardants retards retching +retouched +retracted retreading retrieved -retrievers return -revalues revaluing +reversals reviling -revised -reward +revivalist rewires +rewiring rewrote rhapsodised -ricing +rhinos +riches +richness ricksha -ridiculousness -rightful +riffling +rioters ripeness -riskiest rivalled robbers -robotics +robing rogue rolls romanticist +romps rooted -rosebuds -rotting -roundups +roughness +roundworms rouses -routs +routines roving -royal +rubbishy +ruffian ruffling rugby -rummaging +ruggedest runner rusks -rusted rustlers -sabbatical saboteurs -sacerdotal sachets -sacrificed sages +salvaging sandhog sandiest -sashes -satellited +saprophytes +sarape +sasses +sated +satirist sauna sauntering savager savories savory -savouries savoury -sawed sayings -scabbiest +scabbier scald scale scalloped scalpel -scandalised +scandalmongers scanting scants -scarabs -scenic -schlock -scholar -scholarship +scented +schoolchild scofflaw +sconce scoops scored scoring -scoured scowled scrappy -screechy +scrawnier +scribble scribes scrolling scuffles scull scums +seabeds sealant -seaplane -seasick +sealers seaway +seaworthy +secedes +sectarian securer sedans -sedately -sedatest -seeded +seductive seers -selfishness +seesaws +seismologists +selection selflessness semen seminars +sensational sensitised sentences -sentient +sentimentalising septette serest -serum +serviced +settee setter -settling severing sexed -shabby -shacks shadier shakeup +shall shameless +shams shanghaiing shapeliest shark +shawls sheaf shearers -sheepish +sheen sheikhs -shepherd shied -shillelagh shirred shittiest +shoaled shocker -shockingly shocks -shoos +shoehorning +shoehorns +shoemakers shortens -shorting -shovelling showdowns -showiest +showed +showgirls shrew -shriller +shrieked +shrinkable shuck shutters -sibyl sickbed -sidelights +sideshow sierra -sighted sighting signalise sillier +silliness silted simmering -simplification -singsonged -sisterhoods +simmers +simplest +singsonging +sisterhood +situation +sixpences +sizzle sketches sketchiest skews skylight -slashed -slavish +slaloms +slashes slays -sleepless +sledging sleepy slicking -sliders +slimiest slink slovenlier -sluttish +slowdown +slyly +smack smeared +smears smelly smirk smoked -smoldered -smudgier -snacks snaky snappiest +sneezes snifters -snippet snivelling snobbish snooping -snuff -soakings +snooty +snorkel +snuffles soaped sobbing +socialism +sodden sodomy softly -softness -sogginess solar -solemnises -solicitors -solidifies +solemnise +soliciting solutions songs +sonnet +sophistries sophists -sophomoric sounded southeast +southwesters +spacecraft spacy spanning +spaying +spearing +specie speckle -spines +spectrums +speediest +spirals spirit spitted splashing -splices splines split -splits -splotched +spoliation +spontaneous spoonbill sporting -spotlighted -sprats +spouts spreading +spruce spumone -squared -squashed -squashiest squeeze +squired squirms -squirmy -stabling +squirted +stagehand +stagnation stair stalks stanchest stand stank +starchier starling -starter -starved stationing -staunchly +statuary +steadier steeds -stencilled steppes -stepson -sterilised +sterile stiffed stiffening -stigmatising stilettos -stilled -stoic stoniest stores stout -straightaway straw -streetcar -strikeout striped -stripteases +strips striving stroll strongly -structural strumpet -studies -studiously +stultifies +stupidities +sturdiest styes styles -stymie +stylishly subbing -subcontractors subjoining sublime +submitting suborns -subscribers subway +succotash sudden sugaring +suggesting suitcase -sulfurous -sumps -sunnier -supercharger -superficial +suiting +suntan +superbest +supernovae +superstitious +supplements suppuration -surfaced surgery -surgical surpass -surplused +surplus +survive suspecting swabs -swanked +swampy swarms swashbucklers swathes sweeper sweet -swirly swisher -switchback +switchbacks +switchblades switcher swoon +swordfishes swordsmen -synching -syringed +synagogues +synthetics table -tabled tacos +tacticians +takeoff talkative -tamales +tallyho tames tanager tango +tannery tapping taprooms +tarmac tarpon tarry tarts -tasted +tasters +taunt taupe +tautest tautness tawdrier taxonomic +taxonomies taxying teapot tearoom -techs -tedious tedium teeming -teepees -telegraphing +telegraphic telephonic telexed -tempest tempts -tenderfeet +tenseness tenured +tepee terminable -terrapins terrarium -territorials -terrorists thaws +theatrical theirs +theology theorise theory thickset -thirsted -thirsts +thighs +thins +thirstier thistle -thoughtfulness -thoughtlessness -threatened -threshes +thrashed thrive thronged thronging throttles throwback -thrust thundered -thunders -thymuses -tiebreaker +tiding tiled +timidest tinges +tinker +tinseled tinsmiths +tippers tipplers tipples tipsiest -tipsily +titmouse tittles toads today togae toggle tokenism -tolling toolbar -topside -torpedoing torso -tortes -tortoiseshell torus totally toupees -towel track traducing -tragicomedies -trample +traitors tranquil -tranquilest transducers +transferable transformed -transited -transposes -treadle -treasonous +transforms +transience +transitioned +trespassed tribe -trimming -trivialises -troika -trots +trick +tricycle +trimesters +trotted +trouble +trumpery +truncate trunking -trustworthier +trusteeship trysted trysts -tubeless tubes +tufts tulip tulle -tumbler -tuneful tunnel -turbojets -turnkey -turtledove +tunnies +turbid tusked +tuxedos tweak -tweeted +twentieth twerp twigged -twiggier twiggy twilight twill -twittered +twinged +twosome tykes typed -typewriter -tyrannises +typesets +typewrote +tyrannical tyrannosaurus -ukuleles +udders +ulcerating unable -unclasping -uncles +unalterably +unbosom uncut undaunted -undemocratic -undergrowth +undercharged +undignified +undisclosed undresses -unearths +unfathomable unfurnished +unicameral universe +unjustly +unmannerly +unobtainable +unofficially unperturbed -unplumbed +unprepared unproved +unpunished unreasoning +unrelieved unrolling unscramble -unstressed -unsupervised unthinkingly +untouchable unwanted +upheld uplifts uppermost uprisings upset -upside -urbanising -ushers +urbanest +urgency +users +usherette utensils uvulas -vacationer +vacuums valence valid valise -valueless +variously veils velour vended -verbalises +venerates +ventilators +verbs veterinary vexed vexes vibes -vibrated viburnum +victuals +vigilant villager villainous villas -virgins -visas +vindictive +violins +violists visitations +vitalising vitiation +vociferating vogue -voiced -volunteers +volley +voter voyeuristic waddling wagers -wails -wainscotting -waistband waive -walkways -wallpaper -wanner warding warlike -warlocks -warrantied -warrants -washbowls +warmers +warranty waste -watched waterbed -watering +waterlines +waterway waylay -waywardness weaken weaker -wedged +wedded weedier weedy -weepies +weekday +weepy weevil -westward whaler wharf +whats +whelked +whereon whims -whinnied -whorehouses +whines +whirled whose wider wight wildcatting wildebeests wiling -windstorms +windpipe wines -wingtips wired wises wispiest wisps -woman +wizardry +woefullest wonderfully -wonderment woodpeckers -woodsy -woofs wordiness -worldly -worsening -worthiest -wraith +worsens wrapped -wrapper -wrathful -wreckers +writhe writs wryly -wryness xenon -yakked yogins yokel youngest -yuckiest yummy yuppies +zaniness zebra -zigzagged zings -zippering -zither -zithers -zoology zygotes \ No newline at end of file diff --git a/04-word-search/count_1l.txt b/10-word-search/count_1l.txt similarity index 100% rename from 04-word-search/count_1l.txt rename to 10-word-search/count_1l.txt diff --git a/04-word-search/example-wordsearch.txt b/10-word-search/example-wordsearch.txt similarity index 100% rename from 04-word-search/example-wordsearch.txt rename to 10-word-search/example-wordsearch.txt diff --git a/04-word-search/exmaple-wordsearch-solution.txt b/10-word-search/exmaple-wordsearch-solution.txt similarity index 100% rename from 04-word-search/exmaple-wordsearch-solution.txt rename to 10-word-search/exmaple-wordsearch-solution.txt diff --git a/04-word-search/huge-unpadded-wordsearch.txt b/10-word-search/huge-unpadded-wordsearch.txt similarity index 100% rename from 04-word-search/huge-unpadded-wordsearch.txt rename to 10-word-search/huge-unpadded-wordsearch.txt diff --git a/04-word-search/huge-wordsearch-1500.txt b/10-word-search/huge-wordsearch-1500.txt similarity index 100% rename from 04-word-search/huge-wordsearch-1500.txt rename to 10-word-search/huge-wordsearch-1500.txt diff --git a/04-word-search/huge-wordsearch-old.txt b/10-word-search/huge-wordsearch-old.txt similarity index 100% rename from 04-word-search/huge-wordsearch-old.txt rename to 10-word-search/huge-wordsearch-old.txt diff --git a/04-word-search/huge-wordsearch.txt b/10-word-search/huge-wordsearch.txt similarity index 70% rename from 04-word-search/huge-wordsearch.txt rename to 10-word-search/huge-wordsearch.txt index f5a13ab..0bfe777 100644 --- a/04-word-search/huge-wordsearch.txt +++ b/10-word-search/huge-wordsearch.txt @@ -99,744 +99,705 @@ trxrmgmsinimefestaniridihueiokfkdedutingamsnoynacqndecayswceagdoarakagcelniesvsn sgeosdrenblurbscaldahomnnoncncimonoxatkineticrseqorhnarksokurlsqplrreteaiheeeerepwrylykpdtubesuerogi qmsaesuohdraugzuiecvemsgigtycnangiopatawdrieroawjsonscallopedsesiwpratstclfddoiastelfaelihbumblersru itekrandomisessvrraayrgripestsivitcellocsbawsshapeliestmjgnitontoofhylluftsaobwsocilacidlocatedlrsee -aberrant -aberrant -aboriginals +abetter +abeyance +abloom +abolitionists +abominate abound -absently +abroad +abscond +abstaining abstracted +abstracting +academic accidents -accountability -accreditation -achieve -acidly -acrostic -actionable +accurateness +acidifies activist +acupuncturists acute adapter +adaptors addle adjective -adjourned adjudges adjurations adjuring +admirals +admission +admonitions +adobes +adorning adorns -adulterating -aerial -aerodynamics -aesthetics -aflame +adventuresome +advocated afternoons agates aggregate -aggrieving agings agrarians aimed +airdropped airlines -airmailed -alderman align alive +allegedly allergy allusive +aloes +aloha along -aloof -alternate +alphabetically +alterable alumni -amalgamate +amassing ambiguously -ambition -ambles +amending amends +amenity amity amongst -amorously +amplify ampule -analgesia -angular -anions +anatomical +anesthetize +annexing antennae antimatter -antipastos -antiperspirants -antiseptic antitoxins aplenty -applications -appropriated -approximate +apparent +appealing +applaud +aquanaut arcade -archdeacon -argosy +arduousness aristocrat +arithmetically armed armful +armorers +arose around +arrogance +articulating +artistically ascetic aspiring +assessor asset assumed assurance atelier -atheist -atrophies -attenuation attire -auction -audacious -augustest -automates +auditoriums +auguster +autobiographical +autographing +autoworkers availability avenger +aviary avidly awaits -awarding awkwardest -babbles -babies +backbone +backfire backhand backslide -backtracked bacterium bagel balanced +balances baldest -balling balmy balsa banister -banjoes +banking banks +banshees barbed -barbeques +barbered bards -bareback barge baring +barker barley -barrister baselines -baseness basil -basting bathe batter baulk -bawling beatify bedfellows +bedraggling +bedroom +beehive +beepers beetles -befogs begot +behest +belayed belches -belief -belladonna bells -bemoaned bench -benchmarks -benefitted -bereavements bereft +beryllium +besides +besotted bestrid -bestride -betaken -bethinks -bewitches biased biassing -bicycles -biennials bight -billowing bimbo binging biopsy -biotechnology birdie -birthright -bisexual -bitingly -blackguards +bitchy +blamelessly blanched -blankest -blasphemes +blanches +blandly +blanketed bleeder -blithely -bloods +blockades +bloodier +blouses blown -blundering blurb blurt +blushed boards +boardwalks boastfully -boatswain bodies -bodkins boilers -bombardment bongo -bookkeeper boorishly booties -bordered bossy botches -bothers -bottles -bottomless boughs +bouquet bowels braggers +braiding brasher bravery break -breaststrokes breathy -breech breeding brier brigands +brightness brink brisket -broncho +broilers +brokering +brontosaurus brooms brought -brownest bruise +brunettes +brusquest +brutalises bucket buckskins bucolic budging -buggers -bulks -bulldozer +bulges +bulldogging +bullish bully bumblers +bumps +bundling bunglers -bungles +burbled burrows +burrs bursitis -busily -busybodies +bushmen +bustling butterfingers butternuts buttocks +buzzards +bylines bywords cabals cactus -cadavers cadge -caftan caged caked +calabash calcium calicos callously -calms -cameraman +canards cancelled -candidacy +cancelling canine -canister +cannoning cannot canoes +cantors canyons -capitalise +captaincies caramel +caravan +carbides +carbonating +carcinogenic +cardigan caressed cargoes carousel carouser +carpels cascading +cassava +cassocks caster -castigate castigator -catalogued +casualties catapult -catcall +catchings caudal +causing +caustically +cavernous +celebratory cellist -certifications chaffed -chainsaws +chairman chairwomen chaise chance -chancels chanty chapped chaps -charge +charismatics chars -chastisements -chauvinism -cheaper +chasten cheaters cheers +cheesed cheques chiefs chiffon -chimaera -chime +childishness +chiropractics chirp -choir +choose chopping chores christen chromes +chromosome chronometer +chummier +cinchona +circumflex +cirrhosis cistern citadels -civet +citron +civilian civilises -clacks -clamours -clapped -clarified -classier classrooms +clause +clavicles claws cleanse -clearinghouse -clicked -climaxing -clincher -clinging -clocking -clocks -clung +clockworks clutch -coalesced coaster coccus -codding +cocooning codifies coevals -coexisted -coldest +coiffuring +colitis collar +collections collectivists -colonialist -colors +collieries +colonial comatose combats -commandeered +comeuppance commas -commend -commentator +communist +communities +compaction complains -completing -complimenting -compromise +complication +compulsory +compute conceal -concertinaed -conciliated +conceived +conceptions +concertmasters concluding concordant -concourse concrete -condemns +condoes condor +conferment +confession confide configuration -confining -confront congaed -congesting -congregates -conjunctive +congeals +conglomerate +congratulatory +conjure connection conniver conscience -consortia -constellation -constructing -contaminate -contested +consorts +contests contrasted +contrives controllable -contumacious contuses +conversational conversions -convicts convinces -cooper +coons +cooperates +coppice copulate -copyrighted cords -corked corms corpse +corrupts costars costliest cotyledon +counterbalance +counterexample +countersinking coupled coupon -courtships -coves -covets -cowbirds -crafty -cranial -crated +coverage +crackerjack crater -crayfishes +crawlspaces +crayon crazy -credenza +credulity creeks cremate -crewed +crewman crier +crinolines crispier croak -croupy +crosier cruet +crushing cubic culling +culminate +cultivates cupola +curates curdles curdling -curfews curiosity curler -custard +custodial customers -cutesiest -cutoffs cycled +cylindrical dabbed -daguerreotype daiquiri daisy -dallying +damaged damming +damping damps -dandies dandled -dangling dapperest darns -dazed +dauphin +dawdlers +dawned deacon -deadpanning dears deathblow -deaths +deaves debarks -debauches decamping decay +decently +decentralises decentralising -decoded +deceptiveness +decommissioning +decompressed +decontamination decree deduces -deductibles -deeming -defecation -defender -deformity -delayed +deducted +defend +deference +deficient +deflector +dehumanising +delight delis -deludes demagnetises +demitasses +demographics +demonstrated denotes dentures -denying +departure dependence dependent -deploys +depopulates +depopulation deposit -deposition deputy -desecrate -desensitised +derivation +describing +descries deserted -despot -detect +desiderata +designed +despises +destines detox -deviated +deviants devised devolved devotees -devour -devours -dictated +diagnostic +dicks dictatorial -differently -diffusing -dimensional -diminuendo +diffidence +dimmers dinned -direst -dirtying +directs disable -disassociating +disagree disavows discolor -disconnecting -discontentedly -discontents discrimination -discursive -discusses -disgruntled -dishonor -disillusioning -disinherit +disease +disestablished +dishonour +diskette dismal dismay -disowns -disparages disparaging -displays -displease -disported -dispossessed -disprove -disrobing -dissimulates +disreputably +dissenters +distortion distrusts +dived divesting -divulged +divests +dividends divvied dogged dogies dogtrot dogwoods dominant +donations dosed -dosing doted -douche -downstage -dowsed +doughtiest +doves draft -drape -drawn +drank +drastically drenches -driblet drifter +drink drivel drollery dross drowsy +dryad duding dulls dusts dynamic -dynamism eager eardrum -earnings eastern echelons -editorial -educates -effusion -egalitarians -egotist -eighteenths -electrifies +ecstatically +eighteens electrify -electrolyte -elevated elides -elsewhere +ellipse elucidated -embarrassingly +emailed embed -embezzle emery +emote +empathised empty -enabled enabling +encamping encrusts endless endow -enemy -enervating +endurable +energised engagement -engineers engorged -enjoyable -enlists +enlightening enquired enrapture -entertains -entreat -entreaties -epaulette -epiglottises -epitaphs +enrichment +entertainers +enveloping epoxies equability -equivocated -eradicating +error erupting escape estranged -evacuates +eternity +evacuees evades evict evidenced -examiners +evidences excavations -exceptionable -excruciatingly -excursion -executing -executives -exertions +excommunicating +exhibitor +existential exited -expectorant +exorcisms expectorates +expediencies expend -expense +experiment expire explicated -exploitative +exploitation +exponentiation expostulates -expressive -extemporised -extincted extort -extraction extraditions -eyetooth +exultant +exulting +eyeball fabled fabricates facades -facet facilitate facts faeces fagots -fainted fairies -faithless falsest -falsifying falsity +fanned fanny -fasten -faulted +farther faunas -favored fazes fealty feared feedings -feinting +feels +fellowships feminism -fettle +fences feverishly fewest fiery -fiestas +filberts finals -finch finis -finked -firewalls -firsthand -fitted +fishtailing +fixatives +fixedly fixers +fixtures flaps flashed flashers -flattery +flautist fleeced fleshy flier +flightless flinching -flings -flippest -floating +floozy +flopping florae -flour -fluidly fluke -flummox -fluxing +fluoresced +fluoridated foams foamy -fogeys folds -foolishness +foothold footnoting footwear -foppish -forbearing fords forebodes -forefront -foreordained +forecasting fores +foretasted forge -forgetful +formalise +formulation +fortissimo +fossilised fouler -fountainheads -fractures -frankfurter -fraternises fraud freaky -freeman -freestyles -freighter +fretted friar +fridges fried -friends -friendship fries frigid -frillier -frills -frippery frolics frosty frowsy -frugality -fruiting fruits fryer fucker fuddled -fulminated -fumbled +functioned funnel funner -funniness -furious furriest fused -gabardines -gadabout gages -galleons gallivants +gallstone gambol -gamete -gamines +ganglion gaping -gardens -garnet +garish garoted garret -gashing +garrote +garrotted gasket +gateway gawkiest gawkily +gazebo gecko -genome +genies +genocide genre gentle -gentled -geographers -getup gewgaw gibber gifting @@ -845,369 +806,401 @@ gimme gingersnap gingivitis girdle -girds gladdened glade -glades glamors glances +glassware +glassy glider -glitches +globules glues glyph +gnarly goals goblets +godchild golfs gonna -gopher +governesses grace graded +grandmas +grandmother +granular gratefully -gravestone -great +grayer +greatness +greenest greenish -greenness +greyed greyish +grilles griming grimy grinder grinned gripes +groans +grooves grovels growling growls grubbing gruesomer -grumpier +gruffly guardhouse guess guild +guillotined guiltier gummy gunfire guying gybes -haggle +habitat +haemorrhoids +haggled hairdo -hairstylists -halfpence -haloed +haled halves -handbooks -handcar -handiest -handmaiden +hampered handspring hankering happen -harem +hardback +hardened +hardens harken -harming +harping hasps hatch havoc -headhunter +haycocks headmistress -headway heady heaps -hearsay hearses +heartthrob heaving +hefty height -heliotropes -hellhole -helmets -hereabout -heroins -hideouts +heliports +helpers +helplessness +hemlock +hennaed +heroics +highlighting hikers hills -hinterland +hirsute hisses +historian hitch -hitches -hoarseness hobnobs hokiest -holiday -homegrown +holder +holdings +holstering homesteading +hometown +homogeneous honester -honking +honeycombing hooks -hopscotches -horns -horseshoeing horsetail -hospital -hugest +horticulturist +hottest +housemothers hugged -humanity -humbleness humbler +humidifiers hunch -hydroponics -hying +hunted +hurrayed +hybridising +hydrae +hydrogenates +hyenas hymens hyped hypersensitivities -hypertext +hypocritically hypos +hypothermia iambs icing -identified +ideology idlers +ignominies +ignominy ikons illicit +illuminated +imitate immediacy -immerses -immobile +immigration impalas -implementing -imprecations -impregnable -impresarios -impresarios +impeach +impending +impersonates +implementation +importunity impulse incises -incubus -indigents -industrialised +inclement +inclosure +incrusting +indiscriminate +inductees +inefficiencies inertia infests -infinitesimally -informational -infractions +infighting +inflects +inflorescence infringements -infusion inhere inheritance -inimitable +injunctions +innate +innocent +inoculating input -inseam +inquisitors insight +insinuates insists +insolent instalment -institution -insufficiency -insulation insulted +intaglio intent -intercede -intercepts -interconnect +intercourse interference -interfering -interlinking -intermarries +interlinked interpolated interpose +interventions intones +intruders +intuition +inundated inveighing invent -inventors inverses -irons +inverting +inveterate +inviolate +invitingly irradiates -irreparably -irrevocable isotropic -itched +itemisation jabbed +jackhammer jaguar japans +jaywalk jeeps jellying jewelry jibbing jibed -jinnis +jitterbug jiving jobbing jokes +joking +jollying jolted -jovially +journeyman joyrode -junket -juntas -juvenile +jugged +juleps +justifications +kaleidoscopes +kazoo keepsakes kennelled +kernel +kestrel keynotes khaki -khakis kilobytes kinder kindles kinetic +kissed +kittens kitty +klutzes +kneed kneel knifed -knits knitting -knuckles -koshered +knobs +known kowtowed krone -laborious laced -ladling laity +lamentably +lamps +lancet landmark -lapidaries lather latrine latticework -laughingstock laughter -lavisher +lavishness lawfulness +laxness laymen lazes lazied lazies leaflets +leapfrogging leaves +ledger +leeks +lemma +leprosy lessors letter levee libel liefest lifeline +lightning likes limbo limed limestone limit -limping liner +lingos +liqueur lithography -liveries -llanos -loath +litter +loaning lobby located lockets -loftiest lollipops longish -loony +looking +looney +lorgnettes lotto -loveliness loves +lowbrows lurked lusted +lyceums lyrical mackintosh magisterial +magnesium magnitude -magnolias +mailbox mails -mainlined -makeups -malarial +mainsprings mammas -mandrill -manifestoes -marchers +manning +mantra mares -markedly +marketer +markups +maroon martinis martins -masques -masterpieces +masonic +massacred +mastiffs matchbox -maternally -mathematically -matrons -mausoleum +matchstick +matriarch +mauls +mawkish maximal -mayhem -meadowlark +mayoralty mealy medias -mediator -medicated +mediocrities meekly mellowest -melodically melon -mental -mentioned -meringues +menstruated +mentor merinos +mermaid +mermen +messenger messiahs -metacarpus -metastasis +metamorphosis +metastases meteorological methodologies -metres -midriffs -miked +metrication +mettlesome +mewled +micron mikes +mildness miller mills mined +minestrone minicam -minuends mirror mirth misadventure -mischief +misanthropic +misdirected +misers misgivings -misinforms +misgoverning +misjudgement misread missile missives mister -mistime +mistyping mitre +mitring mitten mixer -mocks modal moiety moister -moisturising -molasses moleskin -molested -monarchic +momentous +monarchist monetarily -monopolised -monthlies -mooning mooted moppets morbid mornings morsel -mortgage +mortar +mortify motels -mothballing -motherboard -motionless motorcars -moused +motorcycling +motorists +moulded mouths -movable movers muffling -mullahs -multiplexers -multiplexes -mummers -muralists -musicians +muscatels musings -mussel -mussiest mutate myopia +mythological nagged naively -nakedly nanny napalming narks @@ -1216,161 +1209,173 @@ nasal nationalising naturalised nearby -neglect +negotiate nerds -nestle +neuralgia neutrals -newsletters nicking nicotine -niece -nightmare -noddy +ninetieths +noggins noisily nominees +noncommittal +nonconductor +nondescript nonhuman -nonplused +nonviolent nosegays +nosing notably notified noughts novelties -nuncio +numerated nurse nurture nutmegs +nuzzling oasis +obelisks obeyed obeys +obfuscating object -obliges obscured -obscures -obsequiousness -obsequy -occupation +obsess +obsolescence oceans +octagons octal +octogenarians oddest +offended +offensiveness +officiously okayed -onomatopoeia -onsets +omnibus opaques -operation +openers opinion -oppressor +oppresses +opprobrium +optional orals orated -orations +organised oriented +originating ornery -osteopaths -ostracism -ouster -outcomes -outdistances +ospreys +outcropped outlasted -outlaws +outmanoeuvred outputted -outrageously outsmarted outvoted -overcrowded +overachieve +overeating +overestimating overlain -overland -overnights -overrules +overlies +overpopulate +overrule overtakes overturns overwhelmed owned oxbows -oxygenates +oxide oyster padded paging pained -paled pales palliate palsy +panhandlers panic panier -pantaloons panted -parallels +panther parameter +parapets +parboil parental +parkas parked parsley partner -passions -pasting -patina +pastier +pasturage +patchier patriarchies +paused pauses pawned +pawning pawpaw -paymasters peacock -pearlier peccary -pecked -peculiarities peddle -pediments pedometer peewee -pelagic pellagra pencil penning -peppery -percussionist +peopled +perfumeries +peripatetic +perishing +perkiness permissions perpetuating -perspiration perusals -petiole +peseta +petticoat phallic -philander -phoneying +phantasms +philistine +phosphorescent physicking physics -pianos -piazza piazze +pickaback picks piece pigskin pilaf piling -piloting pimply pineapple pinhole pining -pinned pinup -piton +pitch +pivots pizazz placarding +placing placket +plaice +plainclothesman plane planked plaque +plastic plateful -players -plexuses +platter plighted -ploddings plopped +ploughed plowman -plummeting +plowmen +plowshares +plugins plunge -plusher pocketbook poesy +poetesses poetical poignancy point @@ -1378,724 +1383,719 @@ poised poked pokey pollen -poltergeists +pollsters +poltergeist poltroons +polygraphing polyp +pones +ponytail poplin -popularising -popularity -pornographers +poppy portico portraying postage -postcard -potion potter pounce -pounding practices practised pragmatic prance -prancer prawning prearrange precautionary -preceding -preceptor -precipice -preps +precipitately +predatory +prefigures +preoccupies +prerecord presage +preternatural +prevaricate price -priests primes +print +procrastinators +procreated prodding professor -profitably -prohibitionists +programed prohibitively -promulgating -pronged +promote +pronouncement +proof propane propellers proper -properties proponents proposals -propulsion -protestors -protrusion +proposes +prosecution +prospered +prostituted proves prowl -prudery psalmist +psychotic +puckering pukes puking pullbacks pumice pumped -punchiest -purebreds -purulence -puzzles -qualifier +purely +pursuer +pushovers +pyramiding +quads +quality quarantining -quartette quash querying +quicken quieter quiets -quirkier +quietude quoit rabbinate raceway -racism radial radiant rafts ragamuffin raged +railed raiment raincoat -rajahs raked -rambunctiousness +ramification ramming randomises -rapids +ransomed raptures rasps ratchet ratified -ravel +rationalistic +ratios +rattier raves -ravings -rawer razed razzes reads +reaffirms realise realising +rebuked rebut receive -recliner -recompenses -reconnected -reconnoiters -recreation rectifications recuperate -redirected +recuperation +redeem +rediscovered redistricts redoing -redundant +redrawn reedy reefs -reforests -refuels +reeving regale regally +regenerated regularly -rehabbed -rehearsed +regurgitate reigns -reimbursed reindeers reinterpreting -reinvents -reissues -reiterates relabel relates -remake +relays +remembered +remission remunerated renal rending rends +renounce rents -reoccur reopened -repackage -repatriate repeal -repealed reprobates -reproduce -reproducing -rereads resells resemble -resistance -resolved resonant +resourced +respectably +respire +respond +restating +restored retail -retardants retards retching +retouched +retracted retreading retrieved -retrievers return -revalues revaluing +reversals reviling -revised -reward +revivalist rewires +rewiring rewrote rhapsodised -ricing +rhinos +riches +richness ricksha -ridiculousness -rightful +riffling +rioters ripeness -riskiest rivalled robbers -robotics +robing rogue rolls romanticist +romps rooted -rosebuds -rotting -roundups +roughness +roundworms rouses -routs +routines roving -royal +rubbishy +ruffian ruffling rugby -rummaging +ruggedest runner rusks -rusted rustlers -sabbatical saboteurs -sacerdotal sachets -sacrificed sages +salvaging sandhog sandiest -sashes -satellited +saprophytes +sarape +sasses +sated +satirist sauna sauntering savager savories savory -savouries savoury -sawed sayings -scabbiest +scabbier scald scale scalloped scalpel -scandalised +scandalmongers scanting scants -scarabs -scenic -schlock -scholar -scholarship +scented +schoolchild scofflaw +sconce scoops scored scoring -scoured scowled scrappy -screechy +scrawnier +scribble scribes scrolling scuffles scull scums +seabeds sealant -seaplane -seasick +sealers seaway +seaworthy +secedes +sectarian securer sedans -sedately -sedatest -seeded +seductive seers -selfishness +seesaws +seismologists +selection selflessness semen seminars +sensational sensitised sentences -sentient +sentimentalising septette serest -serum +serviced +settee setter -settling severing sexed -shabby -shacks shadier shakeup +shall shameless +shams shanghaiing shapeliest shark +shawls sheaf shearers -sheepish +sheen sheikhs -shepherd shied -shillelagh shirred shittiest +shoaled shocker -shockingly shocks -shoos +shoehorning +shoehorns +shoemakers shortens -shorting -shovelling showdowns -showiest +showed +showgirls shrew -shriller +shrieked +shrinkable shuck shutters -sibyl sickbed -sidelights +sideshow sierra -sighted sighting signalise sillier +silliness silted simmering -simplification -singsonged -sisterhoods +simmers +simplest +singsonging +sisterhood +situation +sixpences +sizzle sketches sketchiest skews skylight -slashed -slavish +slaloms +slashes slays -sleepless +sledging sleepy slicking -sliders +slimiest slink slovenlier -sluttish +slowdown +slyly +smack smeared +smears smelly smirk smoked -smoldered -smudgier -snacks snaky snappiest +sneezes snifters -snippet snivelling snobbish snooping -snuff -soakings +snooty +snorkel +snuffles soaped sobbing +socialism +sodden sodomy softly -softness -sogginess solar -solemnises -solicitors -solidifies +solemnise +soliciting solutions songs +sonnet +sophistries sophists -sophomoric sounded southeast +southwesters +spacecraft spacy spanning +spaying +spearing +specie speckle -spines +spectrums +speediest +spirals spirit spitted splashing -splices splines split -splits -splotched +spoliation +spontaneous spoonbill sporting -spotlighted -sprats +spouts spreading +spruce spumone -squared -squashed -squashiest squeeze +squired squirms -squirmy -stabling +squirted +stagehand +stagnation stair stalks stanchest stand stank +starchier starling -starter -starved stationing -staunchly +statuary +steadier steeds -stencilled steppes -stepson -sterilised +sterile stiffed stiffening -stigmatising stilettos -stilled -stoic stoniest stores stout -straightaway straw -streetcar -strikeout striped -stripteases +strips striving stroll strongly -structural strumpet -studies -studiously +stultifies +stupidities +sturdiest styes styles -stymie +stylishly subbing -subcontractors subjoining sublime +submitting suborns -subscribers subway +succotash sudden sugaring +suggesting suitcase -sulfurous -sumps -sunnier -supercharger -superficial +suiting +suntan +superbest +supernovae +superstitious +supplements suppuration -surfaced surgery -surgical surpass -surplused +surplus +survive suspecting swabs -swanked +swampy swarms swashbucklers swathes sweeper sweet -swirly swisher -switchback +switchbacks +switchblades switcher swoon +swordfishes swordsmen -synching -syringed +synagogues +synthetics table -tabled tacos +tacticians +takeoff talkative -tamales +tallyho tames tanager tango +tannery tapping taprooms +tarmac tarpon tarry tarts -tasted +tasters +taunt taupe +tautest tautness tawdrier taxonomic +taxonomies taxying teapot tearoom -techs -tedious tedium teeming -teepees -telegraphing +telegraphic telephonic telexed -tempest tempts -tenderfeet +tenseness tenured +tepee terminable -terrapins terrarium -territorials -terrorists thaws +theatrical theirs +theology theorise theory thickset -thirsted -thirsts +thighs +thins +thirstier thistle -thoughtfulness -thoughtlessness -threatened -threshes +thrashed thrive thronged thronging throttles throwback -thrust thundered -thunders -thymuses -tiebreaker +tiding tiled +timidest tinges +tinker +tinseled tinsmiths +tippers tipplers tipples tipsiest -tipsily +titmouse tittles toads today togae toggle tokenism -tolling toolbar -topside -torpedoing torso -tortes -tortoiseshell torus totally toupees -towel track traducing -tragicomedies -trample +traitors tranquil -tranquilest transducers +transferable transformed -transited -transposes -treadle -treasonous +transforms +transience +transitioned +trespassed tribe -trimming -trivialises -troika -trots +trick +tricycle +trimesters +trotted +trouble +trumpery +truncate trunking -trustworthier +trusteeship trysted trysts -tubeless tubes +tufts tulip tulle -tumbler -tuneful tunnel -turbojets -turnkey -turtledove +tunnies +turbid tusked +tuxedos tweak -tweeted +twentieth twerp twigged -twiggier twiggy twilight twill -twittered +twinged +twosome tykes typed -typewriter -tyrannises +typesets +typewrote +tyrannical tyrannosaurus -ukuleles +udders +ulcerating unable -unclasping -uncles +unalterably +unbosom uncut undaunted -undemocratic -undergrowth +undercharged +undignified +undisclosed undresses -unearths +unfathomable unfurnished +unicameral universe +unjustly +unmannerly +unobtainable +unofficially unperturbed -unplumbed +unprepared unproved +unpunished unreasoning +unrelieved unrolling unscramble -unstressed -unsupervised unthinkingly +untouchable unwanted +upheld uplifts uppermost uprisings upset -upside -urbanising -ushers +urbanest +urgency +users +usherette utensils uvulas -vacationer +vacuums valence valid valise -valueless +variously veils velour vended -verbalises +venerates +ventilators +verbs veterinary vexed vexes vibes -vibrated viburnum +victuals +vigilant villager villainous villas -virgins -visas +vindictive +violins +violists visitations +vitalising vitiation +vociferating vogue -voiced -volunteers +volley +voter voyeuristic waddling wagers -wails -wainscotting -waistband waive -walkways -wallpaper -wanner warding warlike -warlocks -warrantied -warrants -washbowls +warmers +warranty waste -watched waterbed -watering +waterlines +waterway waylay -waywardness weaken weaker -wedged +wedded weedier weedy -weepies +weekday +weepy weevil -westward whaler wharf +whats +whelked +whereon whims -whinnied -whorehouses +whines +whirled whose wider wight wildcatting wildebeests wiling -windstorms +windpipe wines -wingtips wired wises wispiest wisps -woman +wizardry +woefullest wonderfully -wonderment woodpeckers -woodsy -woofs wordiness -worldly -worsening -worthiest -wraith +worsens wrapped -wrapper -wrathful -wreckers +writhe writs wryly -wryness xenon -yakked yogins yokel youngest -yuckiest yummy yuppies +zaniness zebra -zigzagged zings -zippering -zither -zithers -zoology zygotes \ No newline at end of file diff --git a/04-word-search/wordsearch-creation.ipynb b/10-word-search/wordsearch-creation.ipynb similarity index 72% rename from 04-word-search/wordsearch-creation.ipynb rename to 10-word-search/wordsearch-creation.ipynb index 52cbbdc..b5daf89 100644 --- a/04-word-search/wordsearch-creation.ipynb +++ b/10-word-search/wordsearch-creation.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 206, + "execution_count": 1, "metadata": { "collapsed": true }, @@ -60,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 182, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -72,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 183, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -81,7 +81,7 @@ "62183" ] }, - "execution_count": 183, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -92,7 +92,7 @@ }, { "cell_type": "code", - "execution_count": 184, + "execution_count": 4, "metadata": { "collapsed": true }, @@ -104,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 185, + "execution_count": 5, "metadata": { "collapsed": true }, @@ -116,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 186, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -143,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 187, + "execution_count": 7, "metadata": { "collapsed": true }, @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": 188, + "execution_count": 8, "metadata": { "collapsed": true }, @@ -175,7 +175,7 @@ }, { "cell_type": "code", - "execution_count": 189, + "execution_count": 9, "metadata": { "collapsed": true }, @@ -189,7 +189,7 @@ }, { "cell_type": "code", - "execution_count": 190, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -298,7 +298,7 @@ }, { "cell_type": "code", - "execution_count": 196, + "execution_count": 11, "metadata": { "collapsed": true }, @@ -362,7 +362,49 @@ }, { "cell_type": "code", - "execution_count": 207, + "execution_count": 14, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def present(grid, word):\n", + " w = len(grid[0])\n", + " h = len(grid)\n", + " for r in range(h):\n", + " for c in range(w):\n", + " for d in Direction:\n", + " if cat(gslice(grid, r, c, len(word), d)) == word:\n", + " return True, r, c, d\n", + " return False, 0, 0, list(Direction)[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def present_many(grid, words):\n", + " w = len(grid[0])\n", + " h = len(grid)\n", + " wordlens = set(len(w) for w in words)\n", + " presences = []\n", + " for r in range(h):\n", + " for c in range(w):\n", + " for d in Direction:\n", + " for wordlen in wordlens:\n", + " word = cat(gslice(grid, r, c, wordlen, d))\n", + " if word in words:\n", + " presences += [(word, r, c, d)]\n", + " return set(presences)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, "metadata": { "collapsed": true }, @@ -404,23 +446,25 @@ }, { "cell_type": "code", - "execution_count": 201, + "execution_count": 17, "metadata": {}, "outputs": [ { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mempty_grid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m20\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mws\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfill_grid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mws_words\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m40\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mws\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m\u001b[0m in \u001b[0;36mfill_grid\u001b[0;34m(grid, words, word_count, max_attempts, min_word_len)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0;31m# print(present_many(grid2, [word]))\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 25\u001b[0m if collections.Counter(p[0] for p in \n\u001b[0;32m---> 26\u001b[0;31m present_many(grid2, added_words + [word])).most_common(1)[0][1] == 1:\n\u001b[0m\u001b[1;32m 27\u001b[0m \u001b[0mset_grid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mword\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 28\u001b[0m \u001b[0madded_words\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mword\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m\u001b[0m in \u001b[0;36mpresent_many\u001b[0;34m(grid, words)\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0md\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mDirection\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mwordlen\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mwordlens\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m \u001b[0mword\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwordlen\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 11\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mword\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mwords\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0mpresences\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mword\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m\u001b[0m in \u001b[0;36mgslice\u001b[0;34m(grid, r, c, l, d)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mgslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mj\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mj\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mindices\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m\u001b[0m in \u001b[0;36mindices\u001b[0;34m(grid, r, c, l, d)\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mindices\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mdr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdelta\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0md\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mw\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0minds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mdr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mdc\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + "name": "stdout", + "output_type": "stream", + "text": [ + "Added 39 ; attempt 9\n" ] + }, + { + "data": { + "text/plain": [ + "40" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -431,9 +475,38 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "emityad..yltnetap...\n", + "noitcesib.selbmur.b.\n", + "....hy...dc.......a.\n", + "..g.et.r.eoretset.s.\n", + "p.rwri.apkud......k.\n", + "udoonu.vaene......sl\n", + "ritmir.elett.....me.\n", + "iseaaf.lspei...taaru\n", + "tssne.teatrd..esp.en\n", + "aiqlcoifedbe.uhs..dh\n", + "nmui.s.yc.ansi.e.nae\n", + "suee.g.bnplunskce.re\n", + ".lss.n.raeag.iemh.gd\n", + ".ast.i.ahan.r.er.u.e\n", + ".t.f.l.enhct.ra.a.nd\n", + ".e..fs.neei.og.l.wik\n", + ".d...u...nnf..e.pde.\n", + "elppa.n..sg....eya.b\n", + ".......s.waist.ls.c.\n", + "suppression.vilere.a\n", + "40 words added\n", + "smashing counterbalancing womanliest teat unedited unheeded puritans apple patently dissimulated bask tester bewares suet herniae nearby idyll geese grader waist grotesques slap peahens ravel suppression rumbles snuffs peeked bisection alpaca enhance daytime trike leaps coifed foremen chunk slings viler fruity\n" + ] + } + ], "source": [ "print(show_grid(g))\n", "print(len(ws), 'words added')\n", @@ -444,48 +517,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def present(grid, word):\n", - " w = len(grid[0])\n", - " h = len(grid)\n", - " for r in range(h):\n", - " for c in range(w):\n", - " for d in Direction:\n", - " if cat(gslice(grid, r, c, len(word), d)) == word:\n", - " return True, r, c, d\n", - " return False, 0, 0, list(Direction)[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def present_many(grid, words):\n", - " w = len(grid[0])\n", - " h = len(grid)\n", - " wordlens = set(len(w) for w in words)\n", - " presences = []\n", - " for r in range(h):\n", - " for c in range(w):\n", - " for d in Direction:\n", - " for wordlen in wordlens:\n", - " word = cat(gslice(grid, r, c, wordlen, d))\n", - " if word in words:\n", - " presences += [(word, r, c, d)]\n", - " return set(presences)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -496,7 +528,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": { "collapsed": true }, @@ -510,7 +542,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "interesting(g, ws)" @@ -518,7 +552,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": { "collapsed": true }, @@ -536,7 +570,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "g, ws = interesting_grid()\n", @@ -547,7 +583,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": { "collapsed": true }, @@ -564,7 +600,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": { "collapsed": true }, @@ -589,7 +625,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": { "collapsed": true }, @@ -601,7 +637,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": { "collapsed": true }, @@ -613,7 +649,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": { "collapsed": true }, @@ -624,7 +660,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": { "collapsed": true }, @@ -655,7 +691,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "cat(sorted(random_english_letter() for i in range(100)))" @@ -664,7 +702,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "cat(sorted(random_wordsearch_letter() for i in range(100)))" @@ -672,16 +712,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "'h'" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "random_wordsearch_letter()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": { "collapsed": true }, @@ -701,7 +752,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "padded = pad_grid(g)\n", @@ -711,7 +764,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "print(show_grid(g))" @@ -721,6 +776,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -731,7 +787,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": { "collapsed": true }, @@ -749,10 +805,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 55, + "metadata": {}, "outputs": [], "source": [ "def decoys(grid, words, all_words, limit=100, min_word_len=4):\n", @@ -760,7 +814,12 @@ "# dlen_limit = max(len(w) for w in words)\n", " while len(words) + len(decoy_words) < limit:\n", " d = random.choice(all_words)\n", - " if d not in words and len(d) >= min_word_len and not present(grid, d)[0]:\n", + " if (d not in words and \n", + " d not in decoy_words and \n", + " len(d) >= min_word_len and \n", + " not any(w in d for w in (decoy_words + words)) and\n", + " not any(d in w for w in decoy_words) and\n", + " not present(grid, d)[0]):\n", " decoy_words += [d]\n", " return decoy_words" ] @@ -768,7 +827,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "ds = decoys(padded, ws, ws_words)\n", @@ -779,6 +840,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -791,6 +853,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -809,6 +872,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -827,7 +891,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "ds_original = ['regards', 'perfect', 'instants', 'refined', 'coddle', 'fickler', 'gambol', 'misprint', 'tapes', 'impugns', 'moonshot', 'chump', 'brick', 'siren', 'faddish', 'winced', 'kielbasy', 'market', 'puckered', 'trains', 'welts', 'cackles', 'foaming', 'proceed', 'gliding', 'guts', 'uric', 'oaks', 'molested', 'curled', 'boor', 'solaria', 'gristle', 'bombing', 'loamier', 'ensuing', 'cunt', 'sunder', 'revel', 'coaster', 'grunts', 'mucking', 'typesets', 'carnal', 'whimsy', 'scoff', 'coccyxes', 'meanly', 'sprain', 'minuend', 'ringlet', 'fest', 'winced', 'shinier', 'dicier', 'thirds', 'olives', 'garoting', 'pastrami', 'tranquil', 'tamped', 'sunup', 'crumbled', 'throw', 'ridges', 'chaplets', 'curlier', 'lugs', 'collies', 'adapting', 'demeanor', 'deepen', 'lanyard', 'tiller', 'transfix', 'wariness', 'times', 'mitts', 'dowses', 'creels', 'curds', 'quashed', 'orgasmic', 'ibex', 'retraces', 'casino']\n", @@ -839,6 +905,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -850,6 +917,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -886,6 +954,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "collapsed": true, "scrolled": true }, "outputs": [], @@ -955,7 +1024,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "print(len(ws), 'words added; ', len(set(present(g, w)[3] for w in ws)), 'directions')\n", @@ -981,7 +1052,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": { "collapsed": true }, @@ -997,7 +1068,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": { "collapsed": true }, @@ -1038,7 +1109,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "[w for w in ws_words if len(w) == 16]" @@ -1147,20 +1220,44 @@ { "cell_type": "code", "execution_count": 219, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "\n", - "with open('huge-unpadded-wordsearch.txt', 'w') as f:\n", - " f.write('{}x{}\\n'.format(len(g[0]), len(g)))\n", - " f.write(show_grid(g))\n", - " f.write('\\n')\n", - " f.write(lcat(sorted(ws)))" + "# with open('huge-unpadded-wordsearch.txt', 'w') as f:\n", + "# f.write('{}x{}\\n'.format(len(g[0]), len(g)))\n", + "# f.write(show_grid(g))\n", + "# f.write('\\n')\n", + "# f.write(lcat(sorted(ws)))" ] }, { "cell_type": "code", - "execution_count": 218, + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(100, 100, 1149)" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "w, h, g, ws = read_wordsearch('huge-unpadded-wordsearch.txt')\n", + "g = [[c for c in row] for row in g]\n", + "w, h, len(ws)" + ] + }, + { + "cell_type": "code", + "execution_count": 42, "metadata": { "scrolled": true }, @@ -1278,25 +1375,20 @@ }, { "cell_type": "code", - "execution_count": 221, + "execution_count": 40, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "Attempt 249 ; most common is [('scofflaw', 1)]\n" + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mpadding_attempts\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0mpg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpad_grid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mpm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpresent_many\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mws\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Attempt'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpadding_attempts\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'; most common is'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcollections\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mCounter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mp\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mp\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mpm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmost_common\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mcollections\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mCounter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mp\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mp\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mpm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmost_common\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m\u001b[0m in \u001b[0;36mpresent_many\u001b[0;34m(grid, words)\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mwordlen\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mwordlens\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0mword\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwordlen\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mword\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mwords\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 12\u001b[0m \u001b[0mpresences\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mword\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpresences\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] - }, - { - "data": { - "text/plain": [ - "(True, [('scofflaw', 1)])" - ] - }, - "execution_count": 221, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1314,6 +1406,126 @@ "padded, collections.Counter(p[0] for p in pm).most_common(1)" ] }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "smuiclacphysicsihcnebrevilingdroskcabllupcsowygnitnacsipblustedpesnipilafeldrigclenquireddetnawnufly\n", + "eqdbmnutmegsvtzdtelbanimretanmelptseikwagewoodpeckerstirwaszbdrrdypicksnzikylhsiroobsuspectingsexevd\n", + "cgnittacdliwffisuoniallivsegasplraftstyevcsgcdemrofsnartrmlaydzescpopxehsfannysdiscriminationdoeypen\n", + "nnytimavwharfrepjstswashbucklerswklqimkeosulxnopratpsitaoorsrtrjtthnsmxrelabelesrssstribiscutsddvbrs\n", + "eidgkdesivedaiajshegdtgrgniyugyshohaabrmedgpantedsobeysodgmraoozdteosaboundgfjsmbttpygjujedorhdvboeh\n", + "tverediwtczdtlwdeiaryehacrierhsrmccosiantnnbestridikysreepegarotedadrpslaropausesubepnrdissoteiailld\n", + "narddypasjitligihpesubsrwewfgciuuhfsntizsgingivitislublefotkcuhschrmsensitisedeugnveleygbutsiyjcflud\n", + "eernefunuaiindrsilnsethiokutttaeiapgodsteknerdhlngemldlrslhtrhobnobsizsvdlocdtrszbnjnbpieoizwillkarf\n", + "shiensetnhaepslnnaietundowigvidtrptsrsayiewreogudoecniebbyofugamwhmtntwsufaulcdsmlptbeondrancoeersak\n", + "onhpnnktstsdovgsdicvevqeypblohdoaseomtcdrbaatgnrgdnaiaejspdtscrsoratzdntmrgenqnomiroixqgslltmsbfduee\n", + "lasxiiasehcnerdjomoidodedsoayvebrawnufhcrtrtsgiaxgdekmkrtfodkinoirfekkaagvsermuroalabsreraehsuxxnoet\n", + "grderahepeeweeusiutdirnohmaccsmardrztienunpdeehbomeyxruyralgeskucnoveltiesseirfdpyebuttocksntqlaodne\n", + "nrrsglsmxdupsdwrgoielalgmccuikisexoaaltwfniaidcbtgednzcpoeoatsqoszdgratefullytisportingsweepersaapys\n", + "iawlbpsleeyhgorhulnnstulleemntlgtnmttpssostidstienstcbfnnhggcstegsugaringinsighthrsniftersmmfwicdeoi\n", + "ntabemghsstenongideckefombnlrarlxynieuplplsznnendirswunfgsiehsuensdelbafetkzinterposexldsurtimreelhu\n", + "oegleoaeiusdrixklisecdiaiprovesoatllsdsayebsawrasieeterrlaesihztixsllihygrellapractisedatcneeavgggpr\n", + "sdebzczioferrsexdiadatergthrivelpdagearetrfhststsavrbyriymsrecharupocketbooktrotxextuvznwkunlkaqggtb\n", + "ayrewatmerseespumonebatlnoisemorhcdrnadaubistpoeehiouxcpogaesnsuuyratchetswishereatjingsepnfepckaose\n", + "eosafgcffsrrhsawretpadaspitgewuheaiggiivrllcaamkvgntrodtbsidtutpjnrgretemarapecnarussaugaylcfrpantet\n", + "rretarcurneicwgnpellagraupmsixcdswniodknelgnaaetinusmlomsgibehfedtslabprowldenimnushiedrkaqndltillss\n", + "ntoimlleatgbtlrcsxsehsesitengamedinkafgnonnxtladtabmvkifuentblwaaroeegniyartropieseitoobsnolemedtpuu\n", + "ubqfilentigrigafassevissimagingslgiryuoriitoarnsahaseigodniiyelwblmupwthguorbkobmilkiaxhfeedingspptr\n", + "nanyydnerxaewaryrriaemackintoshwftrsbnasnhsukntrksragasketrpcsraarliptereinterpretingieycoudeggiwtnp\n", + "msrgnylmnkraslitloeettosplinesobtihfgnlgtktmrxealwassetpiykusurbvgijzeejgpkxclrtssfdnrtonnaccordshoa\n", + "aihikersaebkawarrtssraodcrgckrpyekbruesuorhnpennaobwgmoversabidgriwcsketchesuesartetsicgswollefdebcs\n", + "zleticilliozaenkfuftsrnvzylogeldilsrrrcrinoautnitrlbroeidribuiwaeireakrstmioieiadxesnnlrolocsidazdms\n", + "srsyamajsmedlkssrdloyeagevapwanespcemorhucilkxamhroouevilamsidvarcemgtqggezgfdeaerosyygnideerbnquoit\n", + "reprobatesdiyruovasbsidboddubehksoehnssseevklieepuoaetlairetsigamtorocevinneedmspwtnpfincisesuhctulc\n", + "smvrnttsdldfysbcontrollablelfsraleaveseuslvpsavsgbtrshalvesylsuougibmaesesimcpgopavhshortensrszzazip\n", + "vebaeioliedpmsuesilangisgynainhcazingsyymqoqueryingdoreopenedhsendlessasolbbsqlrlsnikskcubetbrknifed\n", + "jiklruonsflefilbsnwodwohsnittupnitfstdretsenohlcrcvsmphngnimirgnidaetsemohgbbaamongstljykwucustomers\n", + "doionfghfaalsotejhlrgmewhiieelbbgniretnuasuqsuiouoazeggqrhrisnoituloswselppitueaowymrioutrrbfruitspa\n", + "veydjogonywisiutvosplithsejlhpesseieinveighingqymnlerlbukfpineappleeunkagfieensrealiseadelaarjeevell\n", + "rkertuiegvgcbodleoievtwhtiiyiomravrsetransducersafelaatemptspbjhkrudenifiudktdscalesfratreaopinionql\n", + "tddyoveterinaryoenrnedaebapgowjuiniepsalmistyxadtinnlenvdnakiebrashereatmneirdsnaecomfaeiidedpskfzii\n", + "kfpbgdtacoseizlfsrfgimrblebehopnrideraemsnfhropatdcdriuieyjnilvmschkhkweentaoutsmartedwlooaefiekydmb\n", + "fewestegwhcpuviacpfrenisreesbtgcktshueckfttuzbemteecaswlpggdaypipmrniakrqeasedoberofmrrqltnhphqdefpn\n", + "dyesightingateonspalfngsdqfbxcellistottrnscchhdesshlhefleindegaasmeatewnulcsekytmrgyoaoecoiilanlatao\n", + "hddrafobjectkatrsaehgdeertiprrzyalndegmreioascontrritspanloieinwiumlzwaoaiissziicnetuimidictatorialo\n", + "renemidmuiretcabgsnwrnhegnoigimletslrywdenreftmdiectrsygdmgrssvsealplyrobcllugxxibegusnmqebycrpsguap\n", + "npstekcolsopyhbnsthtschngpsteppeseesoadwcaibraesvsrhiireediprikvrcrlpydniapisenbibanaoicarlyagrflsss\n", + "epksewpfsbkymacinimincislpsvsvyifxrpaotoirdfzmtoreoomharntseseltiuazaeeslrxarebiajdahvalaslprnoarbez\n", + "soeykbongothistlektasssiidsregsleaiarlreogaiweevilggwznttagrwniaiddroasiioemsoinsaepnnavtrnadidllucs\n", + "illoloverwhelmednilnicneegeetcndjasdmduvrchpnnrfzlurdloarnasenilesabemtdtulestkxuiepctesaerrigdekiup\n", + "rpriyewmjoqxltmivbalqnrigdnglcniinfdamavaoitsgrskseaeyipikliserpcrtheoryysabushnolreerilpedknniesohw\n", + "oproponentsmetliekacotroinaoltrenlinnsidutbgrelrucqpgetgemdklciportosipuaegamitgeplpyautgefegoniarcu\n", + "ecaudalyokelrsttynoiifilipiklstsrrtftaenvoyeuristichnludtaqbgsewinngnirabrergentuleaugsnofgdfrgdlibd\n", + "hahconfigurationontntzghhtomrbtoteorfsgyguostsefninyoranpsaqtllumsaqodnbecrbdysseoluetatzxpdwhesieee\n", + "tpalsygrarcdeobivcsrscinapbtmanirsfmeuliuqnartodayebracpnneowyuaplncaninevnegxeduynrargueuieatllgngp\n", + "ixfleshyukesedteemeueruptingtahmlhirugmvrccontrastedhbehugniblpsueiayamsidadinrealahrenyyrrntcwantoy\n", + "fefmyoginsnnearnisieripenessjedsmethelnaabsromalgtentrrxnilrkgmjlemigfieryedopiwvttanwiafhnisrsseeth\n", + "nonhumanvcknnsnteayuemsncupolargiitapthigreideewosireipieirnooaespoanrcbqygkemwlfieefhdwsppehwmubdkw\n", + "bywordswjtosiohmetlestnemegagnedlnstcontyanlaprimessnbmshockerhleydesseheotossealraodauaascpraardpga\n", + "outlastedtaocsbbcrxmgjeenilefileeavgotsiulrfordssgtrsettautnessbdebbadieilppfurvpopwylleemnsiuoelksg\n", + "ddetsyrtemntalngnpwesuccocddyplqppdeisifmrlpimplyntzecggndsuitcaseskarksnflomdtnekrahecsuetsawfpnpcn\n", + "iawaitssbskoedamenelphzijeuhauwpieudrvzvennerraytudtcpasbsencactlocnrcaltifsretaehccsrnempollenagtii\n", + "essertsimdaehrsciagdrphststrcocrnvstesidiayejswheosedmerqhhltviuakacooksussocondoretsaocnofktptdnnls\n", + "ssrettabiesarptgciideyhitaeidodohbvcynenmsncoesiqyvgvrcuaxauclbcearhgiyhladhniblebiluncraakussenioli\n", + "retsimdtluweoolrssfaajxsendnszehoqaxoeesgdtpmoppetsgueeuamoseyumcyganhtlaibeodetoormoisterpejltolial\n", + "sbtrsyhbbdtprleinmtddesrtaetjhpilusrlrtdssoqderunettceirlteslhcsneofisxaenssregnifrettubudnodgasbtha\n", + "sfeergalebiamfsnouieiobattlaebebeicbdweejrruostolgpozsorslslvleiodefdrietvdniqtadjectivesswdrfgeaapr\n", + "widrisitultscrbdccninelelipahgnimeqeisldpjierweqianeubcetoiwsbikcusenerqniiceslaysxrpbmcedunupagnrnt\n", + "fcclimocleiasoaegsgignduearteudtutolkjugambolbnsrvyibvoxrerniipmupfdetezmysaatrcmpeatoaarfetmftaeuqn\n", + "okideokoslbcewnrxnrsospsnsszreeifelatrinemsnxnaeieeetbcsiurvgiesolqsrtcjyrlinaujstelsneqcpatceeyypte\n", + "owdmmeldeargisiraeipeatsenyecsnvfriilatticeworkndlrfesgnihsalpslagfosuunsprlvarnucjotkptardslassgpcc\n", + "tryltdndlgeehysamtuhtlcsoitmpscelcascadinghlsiceasiyrseovexeditsnghfshpaslpuadicsoasislliiumtocsguie\n", + "wynifnpseydscetdsofacyyiledfiqelihslanifbstslewrevevrycvygetxrhipnestsetoahdstaupsetxneascaearjmisvd\n", + "euamraessliuraeicccecnttmstneroynlstodopolansonsadetieeoinoeoeouwiegarrubqyaitovtdeposittdaatnarwael\n", + "apmeitrrussrarrazqaaraiosgypgbgagsgieunuteworpwartrnmcbrfdcoddsihrpnbearlusddlltpoesyrrtjsyljalwtghe\n", + "rpisasmtoutgidqlsuilctnlgnabiopsyngnbilacwsiibgepeiogstutfnheescseiimptaweiecoaegesdeuyuyfeynominees\n", + "aictrsiarorerromgdiipoirfiwgnilratsnibuohortcgnisaefzedrtslrreylcknlooelahckasrvregisdraeslatheriwhr\n", + "yekopuspalirtuneenfmresmonbslartueneiloqebeakoihstlhirruqapaptaaonilculirskrsqtnnsntaarttdetcartsbao\n", + "bsenobsrclcyamnmeiphrpleenufdeniapeptllnsvkvslkyamymceufsrmawussraneonasdaiutdylsasetmaeacanoesroefm\n", + "ruoejoioeatwptmrtkcaarqtgestappinggprodosicahfnmolimiydflecugtudihgvocieiunlerugpshietetniksgipdntmn\n", + "flierrooicsrliacagunfirejpwhimsdphaatngrreucasueufnrmnilisihiduinnlibetdnqgerfoceaodidsdewotwokrgals\n", + "latconnmtfoessepaimedcsatdeducesddshsvvaunfxnsrnvgszkugiettgdldtgrqnhqykgdnawnekrnilseisnoopingisgil\n", + "obmibsssylasirralfpameeviecerggeesemrbegecuebvtstoadspynveaelmhdiresonantgtanaugseitiiruolevtizfreao\n", + "uppgdarnsspegnicieersylbatonarpgfhrsodomychaiserelbmuhvgrtnsstseebedliwmoqlarpobncmpryenrapturetertv\n", + "tvawrdzsponccwtfsrnclennutrcainoaapnbhodepbfrolicsaktziuogrosseforpqfdbrazzesbolaopaneseifidocselgee\n", + "vesjeegvojmooeoeslsthukexwudrarnwanxlkestjacvhscgliatesrohcqsdellennekgiqnslueafsalbtkncttclawsrigrn\n", + "ozpbdbycrenekrsindekyasascetredsdodislbrejlrstgocnobscuredhhabsecurerechaliconsfnciacesixcoupledoanl\n", + "tlmeicsihqmaximaltedynnwsdstssldoemtiebeedmdnbnngvgnippohcaeetsmespodtfmesosdnesjaloperpetuatingbosi\n", + "eegggclassroomssniiralitlpsspsewbidtlelpduyedoicsgumgwfswdnmgfotopaetnrtvlsmovrnsfhfsmpilingcppuiafe\n", + "dahhjnprnhwepecnarpeetixyeeredsrtezeredeldmdepkrnmnpqfgsiucsunneaegsueotisaiecreisueyirknittingsbdbr\n", + "rtyeenickinglfygenlxrdigwsievneetfcevthaeeolnaceoiwispsenmedeielgrwblmncertrntdxsibdpsaostokenismdad\n", + "aeedlafgiuigoarnccgezonchnnlktihttfiasllggalwqitcpcencrpttmteldnnutixisbkiilhgeamyseprzkmrhnmldneild\n", + "tvwkibpeatnhwlozifgiigdugtwoafglrtrwizsnwpaiauleaencrorpoaaekiueoissoaihdszanryognhkaaeccceuyegcehad\n", + "ifaitnmsephymsvstaxfstrqhlowziiirdendhiornplpesyecbeboigarxcrldhtslpgrnahswasitsraiortdemysvtjaindne\n", + "berlyinacaepaeateliyortuetlclofnsirrdrooerleystfdcvlvuytireypiiaidamcyrlessdnoluvyzpcsggsidaimraoect\n", + "unloijrerrrcnssacsetuoaaccbpdymciuakfdpreuegatsopasetznlapsnirnmfkzsztynctrgratoeectsoainarepnrmrbet\n", + "tgibpsridceottensigittnrntnalaesfsnnseysworddcgtlrdedoygstrlrnggisimxaoinoscvrcharsapcngmesiamnmkkdu\n", + "tnkyeuejuuselpscatelhdaaarlegabnaeimriohkinderouaydplerylksleegheueevtteleaeezzaipddpismnmntfgfowcsp\n", + "eietdrimpqankffhpyaietgntwtyrbusesgallivantsdyicelxuydpunerjuyttdysinadlcrovejtloeeitsludgeuijnrcipt\n", + "rbredgyperimusoejsrbayetimikesplkdebrutrepnumnbrklwmbanpserahfosmtdimieiscovsrdrvtyraomissluafioisiu\n", + "nbisluelornaaorsteoastrireitliugselttitndxadgsweiufpreiiadmsbnemilqgcrtrnsiepeclrrapteswovasidfvcgro\n", + "uupceraowdyedtgtstulteoneucertsicitnamoraincoatkubfearedkhayyeutycacyclhwlgrcjoeematrvilvendedaeisin\n", + "trxrmgmsinimefestaniridihueiokfkdedutingamsnoynacqndecayswceagdoarakagcelniesvsndwomagpinupjyrlfdntd\n", + "sgeosdrenblurbscaldahomnnoncncimonoxatkineticrseqorhnarksokurlsqplrreteaiheeeerepwrylykpdtubesuerogi\n", + "qmsaesuohdraugzuiecvemsgigtycnangiopatawdrieroawjsonscallopedsesiwpratstclfddoiastelfaelihbumblersru\n", + "itekrandomisessvrraayrgripestsivitcellocsbawsshapeliestmjgnitontoofhylluftsaobwsocilacidlocatedlrsee\n" + ] + } + ], + "source": [ + "_, _, pg, _ = read_wordsearch('huge-wordsearch.txt')\n", + "pg = [[c for c in row] for row in pg]\n", + "print(show_grid(pg))" + ] + }, { "cell_type": "code", "execution_count": 222, @@ -1336,7 +1548,7 @@ }, { "cell_type": "code", - "execution_count": 230, + "execution_count": 56, "metadata": {}, "outputs": [ { @@ -1345,7 +1557,7 @@ "851" ] }, - "execution_count": 230, + "execution_count": 56, "metadata": {}, "output_type": "execute_result" } @@ -1475,7 +1687,7 @@ }, { "cell_type": "code", - "execution_count": 232, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -1484,7 +1696,7 @@ "2000" ] }, - "execution_count": 232, + "execution_count": 57, "metadata": {}, "output_type": "execute_result" } @@ -1495,7 +1707,47 @@ }, { "cell_type": "code", - "execution_count": 233, + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2000" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(set(dws + ws))" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[(a, b) for a in (dws + ws) for b in (dws + ws) if a != b if a in b]" + ] + }, + { + "cell_type": "code", + "execution_count": 60, "metadata": { "collapsed": true }, @@ -1510,18 +1762,23 @@ }, { "cell_type": "code", - "execution_count": 234, + "execution_count": 49, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "(1149, 1149)" - ] - }, - "execution_count": 234, - "metadata": {}, - "output_type": "execute_result" + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mpm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpresent_many\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mws\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mpold\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mw\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mw\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mws\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpresent\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpold\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mpm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpresent_many\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mws\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mpold\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mw\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mw\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mws\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpresent\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpold\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m\u001b[0m in \u001b[0;36mpresent\u001b[0;34m(grid, word)\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mc\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0md\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mDirection\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mword\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mword\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mDirection\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m\u001b[0m in \u001b[0;36mgslice\u001b[0;34m(grid, r, c, l, d)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mgslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mj\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mj\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mindices\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0md\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m\u001b[0m in \u001b[0;36mindices\u001b[0;34m(grid, r, c, l, d)\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mdr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdelta\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0md\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mw\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgrid\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0minds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mdr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mdc\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m return [(i, j) for i, j in inds\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] } ], "source": [ @@ -1532,20 +1789,9 @@ }, { "cell_type": "code", - "execution_count": 235, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(1149, 1149)" - ] - }, - "execution_count": 235, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "ppm = present_many(pg, ws)\n", "ppold = [w for w in ws if present(pg, w)[0]]\n", diff --git a/04-word-search/wordsearch-exploratory-solving.ipynb b/10-word-search/wordsearch-exploratory-solving.ipynb similarity index 100% rename from 04-word-search/wordsearch-exploratory-solving.ipynb rename to 10-word-search/wordsearch-exploratory-solving.ipynb diff --git a/04-word-search/wordsearch-solution.ipynb b/10-word-search/wordsearch-solution.ipynb similarity index 94% rename from 04-word-search/wordsearch-solution.ipynb rename to 10-word-search/wordsearch-solution.ipynb index 01309f6..5c5269f 100644 --- a/04-word-search/wordsearch-solution.ipynb +++ b/10-word-search/wordsearch-solution.ipynb @@ -65,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 1, "metadata": { "collapsed": true }, @@ -92,7 +92,7 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -104,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 3, "metadata": { "collapsed": true }, @@ -116,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 4, "metadata": { "collapsed": true }, @@ -136,7 +136,7 @@ }, { "cell_type": "code", - "execution_count": 118, + "execution_count": 5, "metadata": { "collapsed": true }, @@ -148,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 119, + "execution_count": 6, "metadata": { "collapsed": true }, @@ -162,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 120, + "execution_count": 7, "metadata": { "collapsed": true }, @@ -185,7 +185,7 @@ }, { "cell_type": "code", - "execution_count": 121, + "execution_count": 8, "metadata": { "collapsed": true }, @@ -208,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": 122, + "execution_count": 9, "metadata": { "collapsed": true }, @@ -237,7 +237,7 @@ }, { "cell_type": "code", - "execution_count": 123, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -246,13 +246,13 @@ "(100, 100)" ] }, - "execution_count": 123, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "puzzle = read_wordsearch('04-wordsearch.txt')\n", + "puzzle = read_wordsearch('10-wordsearch.txt')\n", "puzzle[:2]" ] }, @@ -265,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 124, + "execution_count": 11, "metadata": { "collapsed": true }, @@ -281,7 +281,7 @@ }, { "cell_type": "code", - "execution_count": 125, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -290,7 +290,7 @@ "8092" ] }, - "execution_count": 125, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -301,14 +301,14 @@ }, { "cell_type": "code", - "execution_count": 126, + "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1 loop, best of 3: 31.4 s per loop\n" + "1 loop, best of 3: 31.3 s per loop\n" ] } ], @@ -319,7 +319,7 @@ }, { "cell_type": "code", - "execution_count": 127, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -328,7 +328,7 @@ "1149" ] }, - "execution_count": 127, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -347,7 +347,7 @@ }, { "cell_type": "code", - "execution_count": 128, + "execution_count": 15, "metadata": { "collapsed": true }, @@ -376,7 +376,7 @@ }, { "cell_type": "code", - "execution_count": 129, + "execution_count": 16, "metadata": { "collapsed": true }, @@ -399,7 +399,7 @@ }, { "cell_type": "code", - "execution_count": 130, + "execution_count": 17, "metadata": { "collapsed": true }, @@ -420,7 +420,7 @@ }, { "cell_type": "code", - "execution_count": 131, + "execution_count": 18, "metadata": { "collapsed": true }, @@ -432,7 +432,7 @@ }, { "cell_type": "code", - "execution_count": 132, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -441,7 +441,7 @@ "594" ] }, - "execution_count": 132, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -452,14 +452,14 @@ }, { "cell_type": "code", - "execution_count": 133, + "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1 loop, best of 3: 31.3 s per loop\n" + "1 loop, best of 3: 31.4 s per loop\n" ] } ], @@ -470,7 +470,7 @@ }, { "cell_type": "code", - "execution_count": 134, + "execution_count": 21, "metadata": { "collapsed": true }, @@ -481,7 +481,7 @@ }, { "cell_type": "code", - "execution_count": 135, + "execution_count": 22, "metadata": { "collapsed": true }, @@ -493,7 +493,7 @@ }, { "cell_type": "code", - "execution_count": 138, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -502,7 +502,7 @@ "2217" ] }, - "execution_count": 138, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } diff --git a/04-word-search/wordsearch-solution00.txt b/10-word-search/wordsearch-solution00.txt similarity index 100% rename from 04-word-search/wordsearch-solution00.txt rename to 10-word-search/wordsearch-solution00.txt diff --git a/04-word-search/wordsearch-solution01.txt b/10-word-search/wordsearch-solution01.txt similarity index 100% rename from 04-word-search/wordsearch-solution01.txt rename to 10-word-search/wordsearch-solution01.txt diff --git a/04-word-search/wordsearch-solution02.txt b/10-word-search/wordsearch-solution02.txt similarity index 100% rename from 04-word-search/wordsearch-solution02.txt rename to 10-word-search/wordsearch-solution02.txt diff --git a/04-word-search/wordsearch-solution03.txt b/10-word-search/wordsearch-solution03.txt similarity index 100% rename from 04-word-search/wordsearch-solution03.txt rename to 10-word-search/wordsearch-solution03.txt diff --git a/04-word-search/wordsearch-solution04.txt b/10-word-search/wordsearch-solution04.txt similarity index 100% rename from 04-word-search/wordsearch-solution04.txt rename to 10-word-search/wordsearch-solution04.txt diff --git a/04-word-search/wordsearch-solution05.txt b/10-word-search/wordsearch-solution05.txt similarity index 100% rename from 04-word-search/wordsearch-solution05.txt rename to 10-word-search/wordsearch-solution05.txt diff --git a/04-word-search/wordsearch-solution06.txt b/10-word-search/wordsearch-solution06.txt similarity index 100% rename from 04-word-search/wordsearch-solution06.txt rename to 10-word-search/wordsearch-solution06.txt diff --git a/04-word-search/wordsearch-solution07.txt b/10-word-search/wordsearch-solution07.txt similarity index 100% rename from 04-word-search/wordsearch-solution07.txt rename to 10-word-search/wordsearch-solution07.txt diff --git a/04-word-search/wordsearch-solution08.txt b/10-word-search/wordsearch-solution08.txt similarity index 100% rename from 04-word-search/wordsearch-solution08.txt rename to 10-word-search/wordsearch-solution08.txt diff --git a/04-word-search/wordsearch-solution09.txt b/10-word-search/wordsearch-solution09.txt similarity index 100% rename from 04-word-search/wordsearch-solution09.txt rename to 10-word-search/wordsearch-solution09.txt diff --git a/04-word-search/wordsearch-solution10.txt b/10-word-search/wordsearch-solution10.txt similarity index 100% rename from 04-word-search/wordsearch-solution10.txt rename to 10-word-search/wordsearch-solution10.txt diff --git a/04-word-search/wordsearch-solution11.txt b/10-word-search/wordsearch-solution11.txt similarity index 100% rename from 04-word-search/wordsearch-solution11.txt rename to 10-word-search/wordsearch-solution11.txt diff --git a/04-word-search/wordsearch-solution12.txt b/10-word-search/wordsearch-solution12.txt similarity index 100% rename from 04-word-search/wordsearch-solution12.txt rename to 10-word-search/wordsearch-solution12.txt diff --git a/04-word-search/wordsearch-solution13.txt b/10-word-search/wordsearch-solution13.txt similarity index 100% rename from 04-word-search/wordsearch-solution13.txt rename to 10-word-search/wordsearch-solution13.txt diff --git a/04-word-search/wordsearch-solution14.txt b/10-word-search/wordsearch-solution14.txt similarity index 100% rename from 04-word-search/wordsearch-solution14.txt rename to 10-word-search/wordsearch-solution14.txt diff --git a/04-word-search/wordsearch-solution15.txt b/10-word-search/wordsearch-solution15.txt similarity index 100% rename from 04-word-search/wordsearch-solution15.txt rename to 10-word-search/wordsearch-solution15.txt diff --git a/04-word-search/wordsearch-solution16.txt b/10-word-search/wordsearch-solution16.txt similarity index 100% rename from 04-word-search/wordsearch-solution16.txt rename to 10-word-search/wordsearch-solution16.txt diff --git a/04-word-search/wordsearch-solution17.txt b/10-word-search/wordsearch-solution17.txt similarity index 100% rename from 04-word-search/wordsearch-solution17.txt rename to 10-word-search/wordsearch-solution17.txt diff --git a/04-word-search/wordsearch-solution18.txt b/10-word-search/wordsearch-solution18.txt similarity index 100% rename from 04-word-search/wordsearch-solution18.txt rename to 10-word-search/wordsearch-solution18.txt diff --git a/04-word-search/wordsearch-solution19.txt b/10-word-search/wordsearch-solution19.txt similarity index 100% rename from 04-word-search/wordsearch-solution19.txt rename to 10-word-search/wordsearch-solution19.txt diff --git a/04-word-search/wordsearch-solution20.txt b/10-word-search/wordsearch-solution20.txt similarity index 100% rename from 04-word-search/wordsearch-solution20.txt rename to 10-word-search/wordsearch-solution20.txt diff --git a/04-word-search/wordsearch-solution21.txt b/10-word-search/wordsearch-solution21.txt similarity index 100% rename from 04-word-search/wordsearch-solution21.txt rename to 10-word-search/wordsearch-solution21.txt diff --git a/04-word-search/wordsearch-solution22.txt b/10-word-search/wordsearch-solution22.txt similarity index 100% rename from 04-word-search/wordsearch-solution22.txt rename to 10-word-search/wordsearch-solution22.txt diff --git a/04-word-search/wordsearch-solution23.txt b/10-word-search/wordsearch-solution23.txt similarity index 100% rename from 04-word-search/wordsearch-solution23.txt rename to 10-word-search/wordsearch-solution23.txt diff --git a/04-word-search/wordsearch-solution24.txt b/10-word-search/wordsearch-solution24.txt similarity index 100% rename from 04-word-search/wordsearch-solution24.txt rename to 10-word-search/wordsearch-solution24.txt diff --git a/04-word-search/wordsearch-solution25.txt b/10-word-search/wordsearch-solution25.txt similarity index 100% rename from 04-word-search/wordsearch-solution25.txt rename to 10-word-search/wordsearch-solution25.txt diff --git a/04-word-search/wordsearch-solution26.txt b/10-word-search/wordsearch-solution26.txt similarity index 100% rename from 04-word-search/wordsearch-solution26.txt rename to 10-word-search/wordsearch-solution26.txt diff --git a/04-word-search/wordsearch-solution27.txt b/10-word-search/wordsearch-solution27.txt similarity index 100% rename from 04-word-search/wordsearch-solution27.txt rename to 10-word-search/wordsearch-solution27.txt diff --git a/04-word-search/wordsearch-solution28.txt b/10-word-search/wordsearch-solution28.txt similarity index 100% rename from 04-word-search/wordsearch-solution28.txt rename to 10-word-search/wordsearch-solution28.txt diff --git a/04-word-search/wordsearch-solution29.txt b/10-word-search/wordsearch-solution29.txt similarity index 100% rename from 04-word-search/wordsearch-solution29.txt rename to 10-word-search/wordsearch-solution29.txt diff --git a/04-word-search/wordsearch-solution30.txt b/10-word-search/wordsearch-solution30.txt similarity index 100% rename from 04-word-search/wordsearch-solution30.txt rename to 10-word-search/wordsearch-solution30.txt diff --git a/04-word-search/wordsearch-solution31.txt b/10-word-search/wordsearch-solution31.txt similarity index 100% rename from 04-word-search/wordsearch-solution31.txt rename to 10-word-search/wordsearch-solution31.txt diff --git a/04-word-search/wordsearch-solution32.txt b/10-word-search/wordsearch-solution32.txt similarity index 100% rename from 04-word-search/wordsearch-solution32.txt rename to 10-word-search/wordsearch-solution32.txt diff --git a/04-word-search/wordsearch-solution33.txt b/10-word-search/wordsearch-solution33.txt similarity index 100% rename from 04-word-search/wordsearch-solution33.txt rename to 10-word-search/wordsearch-solution33.txt diff --git a/04-word-search/wordsearch-solution34.txt b/10-word-search/wordsearch-solution34.txt similarity index 100% rename from 04-word-search/wordsearch-solution34.txt rename to 10-word-search/wordsearch-solution34.txt diff --git a/04-word-search/wordsearch-solution35.txt b/10-word-search/wordsearch-solution35.txt similarity index 100% rename from 04-word-search/wordsearch-solution35.txt rename to 10-word-search/wordsearch-solution35.txt diff --git a/04-word-search/wordsearch-solution36.txt b/10-word-search/wordsearch-solution36.txt similarity index 100% rename from 04-word-search/wordsearch-solution36.txt rename to 10-word-search/wordsearch-solution36.txt diff --git a/04-word-search/wordsearch-solution37.txt b/10-word-search/wordsearch-solution37.txt similarity index 100% rename from 04-word-search/wordsearch-solution37.txt rename to 10-word-search/wordsearch-solution37.txt diff --git a/04-word-search/wordsearch-solution38.txt b/10-word-search/wordsearch-solution38.txt similarity index 100% rename from 04-word-search/wordsearch-solution38.txt rename to 10-word-search/wordsearch-solution38.txt diff --git a/04-word-search/wordsearch-solution39.txt b/10-word-search/wordsearch-solution39.txt similarity index 100% rename from 04-word-search/wordsearch-solution39.txt rename to 10-word-search/wordsearch-solution39.txt diff --git a/04-word-search/wordsearch-solution40.txt b/10-word-search/wordsearch-solution40.txt similarity index 100% rename from 04-word-search/wordsearch-solution40.txt rename to 10-word-search/wordsearch-solution40.txt diff --git a/04-word-search/wordsearch-solution41.txt b/10-word-search/wordsearch-solution41.txt similarity index 100% rename from 04-word-search/wordsearch-solution41.txt rename to 10-word-search/wordsearch-solution41.txt diff --git a/04-word-search/wordsearch-solution42.txt b/10-word-search/wordsearch-solution42.txt similarity index 100% rename from 04-word-search/wordsearch-solution42.txt rename to 10-word-search/wordsearch-solution42.txt diff --git a/04-word-search/wordsearch-solution43.txt b/10-word-search/wordsearch-solution43.txt similarity index 100% rename from 04-word-search/wordsearch-solution43.txt rename to 10-word-search/wordsearch-solution43.txt diff --git a/04-word-search/wordsearch-solution44.txt b/10-word-search/wordsearch-solution44.txt similarity index 100% rename from 04-word-search/wordsearch-solution44.txt rename to 10-word-search/wordsearch-solution44.txt diff --git a/04-word-search/wordsearch-solution45.txt b/10-word-search/wordsearch-solution45.txt similarity index 100% rename from 04-word-search/wordsearch-solution45.txt rename to 10-word-search/wordsearch-solution45.txt diff --git a/04-word-search/wordsearch-solution46.txt b/10-word-search/wordsearch-solution46.txt similarity index 100% rename from 04-word-search/wordsearch-solution46.txt rename to 10-word-search/wordsearch-solution46.txt diff --git a/04-word-search/wordsearch-solution47.txt b/10-word-search/wordsearch-solution47.txt similarity index 100% rename from 04-word-search/wordsearch-solution47.txt rename to 10-word-search/wordsearch-solution47.txt diff --git a/04-word-search/wordsearch-solution48.txt b/10-word-search/wordsearch-solution48.txt similarity index 100% rename from 04-word-search/wordsearch-solution48.txt rename to 10-word-search/wordsearch-solution48.txt diff --git a/04-word-search/wordsearch-solution49.txt b/10-word-search/wordsearch-solution49.txt similarity index 100% rename from 04-word-search/wordsearch-solution49.txt rename to 10-word-search/wordsearch-solution49.txt diff --git a/04-word-search/wordsearch-solution50.txt b/10-word-search/wordsearch-solution50.txt similarity index 100% rename from 04-word-search/wordsearch-solution50.txt rename to 10-word-search/wordsearch-solution50.txt diff --git a/04-word-search/wordsearch-solution51.txt b/10-word-search/wordsearch-solution51.txt similarity index 100% rename from 04-word-search/wordsearch-solution51.txt rename to 10-word-search/wordsearch-solution51.txt diff --git a/04-word-search/wordsearch-solution52.txt b/10-word-search/wordsearch-solution52.txt similarity index 100% rename from 04-word-search/wordsearch-solution52.txt rename to 10-word-search/wordsearch-solution52.txt diff --git a/04-word-search/wordsearch-solution53.txt b/10-word-search/wordsearch-solution53.txt similarity index 100% rename from 04-word-search/wordsearch-solution53.txt rename to 10-word-search/wordsearch-solution53.txt diff --git a/04-word-search/wordsearch-solution54.txt b/10-word-search/wordsearch-solution54.txt similarity index 100% rename from 04-word-search/wordsearch-solution54.txt rename to 10-word-search/wordsearch-solution54.txt diff --git a/04-word-search/wordsearch-solution55.txt b/10-word-search/wordsearch-solution55.txt similarity index 100% rename from 04-word-search/wordsearch-solution55.txt rename to 10-word-search/wordsearch-solution55.txt diff --git a/04-word-search/wordsearch-solution56.txt b/10-word-search/wordsearch-solution56.txt similarity index 100% rename from 04-word-search/wordsearch-solution56.txt rename to 10-word-search/wordsearch-solution56.txt diff --git a/04-word-search/wordsearch-solution57.txt b/10-word-search/wordsearch-solution57.txt similarity index 100% rename from 04-word-search/wordsearch-solution57.txt rename to 10-word-search/wordsearch-solution57.txt diff --git a/04-word-search/wordsearch-solution58.txt b/10-word-search/wordsearch-solution58.txt similarity index 100% rename from 04-word-search/wordsearch-solution58.txt rename to 10-word-search/wordsearch-solution58.txt diff --git a/04-word-search/wordsearch-solution59.txt b/10-word-search/wordsearch-solution59.txt similarity index 100% rename from 04-word-search/wordsearch-solution59.txt rename to 10-word-search/wordsearch-solution59.txt diff --git a/04-word-search/wordsearch-solution60.txt b/10-word-search/wordsearch-solution60.txt similarity index 100% rename from 04-word-search/wordsearch-solution60.txt rename to 10-word-search/wordsearch-solution60.txt diff --git a/04-word-search/wordsearch-solution61.txt b/10-word-search/wordsearch-solution61.txt similarity index 100% rename from 04-word-search/wordsearch-solution61.txt rename to 10-word-search/wordsearch-solution61.txt diff --git a/04-word-search/wordsearch-solution62.txt b/10-word-search/wordsearch-solution62.txt similarity index 100% rename from 04-word-search/wordsearch-solution62.txt rename to 10-word-search/wordsearch-solution62.txt diff --git a/04-word-search/wordsearch-solution63.txt b/10-word-search/wordsearch-solution63.txt similarity index 100% rename from 04-word-search/wordsearch-solution63.txt rename to 10-word-search/wordsearch-solution63.txt diff --git a/04-word-search/wordsearch-solution64.txt b/10-word-search/wordsearch-solution64.txt similarity index 100% rename from 04-word-search/wordsearch-solution64.txt rename to 10-word-search/wordsearch-solution64.txt diff --git a/04-word-search/wordsearch-solution65.txt b/10-word-search/wordsearch-solution65.txt similarity index 100% rename from 04-word-search/wordsearch-solution65.txt rename to 10-word-search/wordsearch-solution65.txt diff --git a/04-word-search/wordsearch-solution66.txt b/10-word-search/wordsearch-solution66.txt similarity index 100% rename from 04-word-search/wordsearch-solution66.txt rename to 10-word-search/wordsearch-solution66.txt diff --git a/04-word-search/wordsearch-solution67.txt b/10-word-search/wordsearch-solution67.txt similarity index 100% rename from 04-word-search/wordsearch-solution67.txt rename to 10-word-search/wordsearch-solution67.txt diff --git a/04-word-search/wordsearch-solution68.txt b/10-word-search/wordsearch-solution68.txt similarity index 100% rename from 04-word-search/wordsearch-solution68.txt rename to 10-word-search/wordsearch-solution68.txt diff --git a/04-word-search/wordsearch-solution69.txt b/10-word-search/wordsearch-solution69.txt similarity index 100% rename from 04-word-search/wordsearch-solution69.txt rename to 10-word-search/wordsearch-solution69.txt diff --git a/04-word-search/wordsearch-solution70.txt b/10-word-search/wordsearch-solution70.txt similarity index 100% rename from 04-word-search/wordsearch-solution70.txt rename to 10-word-search/wordsearch-solution70.txt diff --git a/04-word-search/wordsearch-solution71.txt b/10-word-search/wordsearch-solution71.txt similarity index 100% rename from 04-word-search/wordsearch-solution71.txt rename to 10-word-search/wordsearch-solution71.txt diff --git a/04-word-search/wordsearch-solution72.txt b/10-word-search/wordsearch-solution72.txt similarity index 100% rename from 04-word-search/wordsearch-solution72.txt rename to 10-word-search/wordsearch-solution72.txt diff --git a/04-word-search/wordsearch-solution73.txt b/10-word-search/wordsearch-solution73.txt similarity index 100% rename from 04-word-search/wordsearch-solution73.txt rename to 10-word-search/wordsearch-solution73.txt diff --git a/04-word-search/wordsearch-solution74.txt b/10-word-search/wordsearch-solution74.txt similarity index 100% rename from 04-word-search/wordsearch-solution74.txt rename to 10-word-search/wordsearch-solution74.txt diff --git a/04-word-search/wordsearch-solution75.txt b/10-word-search/wordsearch-solution75.txt similarity index 100% rename from 04-word-search/wordsearch-solution75.txt rename to 10-word-search/wordsearch-solution75.txt diff --git a/04-word-search/wordsearch-solution76.txt b/10-word-search/wordsearch-solution76.txt similarity index 100% rename from 04-word-search/wordsearch-solution76.txt rename to 10-word-search/wordsearch-solution76.txt diff --git a/04-word-search/wordsearch-solution77.txt b/10-word-search/wordsearch-solution77.txt similarity index 100% rename from 04-word-search/wordsearch-solution77.txt rename to 10-word-search/wordsearch-solution77.txt diff --git a/04-word-search/wordsearch-solution78.txt b/10-word-search/wordsearch-solution78.txt similarity index 100% rename from 04-word-search/wordsearch-solution78.txt rename to 10-word-search/wordsearch-solution78.txt diff --git a/04-word-search/wordsearch-solution79.txt b/10-word-search/wordsearch-solution79.txt similarity index 100% rename from 04-word-search/wordsearch-solution79.txt rename to 10-word-search/wordsearch-solution79.txt diff --git a/04-word-search/wordsearch-solution80.txt b/10-word-search/wordsearch-solution80.txt similarity index 100% rename from 04-word-search/wordsearch-solution80.txt rename to 10-word-search/wordsearch-solution80.txt diff --git a/04-word-search/wordsearch-solution81.txt b/10-word-search/wordsearch-solution81.txt similarity index 100% rename from 04-word-search/wordsearch-solution81.txt rename to 10-word-search/wordsearch-solution81.txt diff --git a/04-word-search/wordsearch-solution82.txt b/10-word-search/wordsearch-solution82.txt similarity index 100% rename from 04-word-search/wordsearch-solution82.txt rename to 10-word-search/wordsearch-solution82.txt diff --git a/04-word-search/wordsearch-solution83.txt b/10-word-search/wordsearch-solution83.txt similarity index 100% rename from 04-word-search/wordsearch-solution83.txt rename to 10-word-search/wordsearch-solution83.txt diff --git a/04-word-search/wordsearch-solution84.txt b/10-word-search/wordsearch-solution84.txt similarity index 100% rename from 04-word-search/wordsearch-solution84.txt rename to 10-word-search/wordsearch-solution84.txt diff --git a/04-word-search/wordsearch-solution85.txt b/10-word-search/wordsearch-solution85.txt similarity index 100% rename from 04-word-search/wordsearch-solution85.txt rename to 10-word-search/wordsearch-solution85.txt diff --git a/04-word-search/wordsearch-solution86.txt b/10-word-search/wordsearch-solution86.txt similarity index 100% rename from 04-word-search/wordsearch-solution86.txt rename to 10-word-search/wordsearch-solution86.txt diff --git a/04-word-search/wordsearch-solution87.txt b/10-word-search/wordsearch-solution87.txt similarity index 100% rename from 04-word-search/wordsearch-solution87.txt rename to 10-word-search/wordsearch-solution87.txt diff --git a/04-word-search/wordsearch-solution88.txt b/10-word-search/wordsearch-solution88.txt similarity index 100% rename from 04-word-search/wordsearch-solution88.txt rename to 10-word-search/wordsearch-solution88.txt diff --git a/04-word-search/wordsearch-solution89.txt b/10-word-search/wordsearch-solution89.txt similarity index 100% rename from 04-word-search/wordsearch-solution89.txt rename to 10-word-search/wordsearch-solution89.txt diff --git a/04-word-search/wordsearch-solution90.txt b/10-word-search/wordsearch-solution90.txt similarity index 100% rename from 04-word-search/wordsearch-solution90.txt rename to 10-word-search/wordsearch-solution90.txt diff --git a/04-word-search/wordsearch-solution91.txt b/10-word-search/wordsearch-solution91.txt similarity index 100% rename from 04-word-search/wordsearch-solution91.txt rename to 10-word-search/wordsearch-solution91.txt diff --git a/04-word-search/wordsearch-solution92.txt b/10-word-search/wordsearch-solution92.txt similarity index 100% rename from 04-word-search/wordsearch-solution92.txt rename to 10-word-search/wordsearch-solution92.txt diff --git a/04-word-search/wordsearch-solution93.txt b/10-word-search/wordsearch-solution93.txt similarity index 100% rename from 04-word-search/wordsearch-solution93.txt rename to 10-word-search/wordsearch-solution93.txt diff --git a/04-word-search/wordsearch-solution94.txt b/10-word-search/wordsearch-solution94.txt similarity index 100% rename from 04-word-search/wordsearch-solution94.txt rename to 10-word-search/wordsearch-solution94.txt diff --git a/04-word-search/wordsearch-solution95.txt b/10-word-search/wordsearch-solution95.txt similarity index 100% rename from 04-word-search/wordsearch-solution95.txt rename to 10-word-search/wordsearch-solution95.txt diff --git a/04-word-search/wordsearch-solution96.txt b/10-word-search/wordsearch-solution96.txt similarity index 100% rename from 04-word-search/wordsearch-solution96.txt rename to 10-word-search/wordsearch-solution96.txt diff --git a/04-word-search/wordsearch-solution97.txt b/10-word-search/wordsearch-solution97.txt similarity index 100% rename from 04-word-search/wordsearch-solution97.txt rename to 10-word-search/wordsearch-solution97.txt diff --git a/04-word-search/wordsearch-solution98.txt b/10-word-search/wordsearch-solution98.txt similarity index 100% rename from 04-word-search/wordsearch-solution98.txt rename to 10-word-search/wordsearch-solution98.txt diff --git a/04-word-search/wordsearch-solution99.txt b/10-word-search/wordsearch-solution99.txt similarity index 100% rename from 04-word-search/wordsearch-solution99.txt rename to 10-word-search/wordsearch-solution99.txt diff --git a/04-word-search/wordsearch-words b/10-word-search/wordsearch-words similarity index 100% rename from 04-word-search/wordsearch-words rename to 10-word-search/wordsearch-words diff --git a/04-word-search/wordsearch00.txt b/10-word-search/wordsearch00.txt similarity index 100% rename from 04-word-search/wordsearch00.txt rename to 10-word-search/wordsearch00.txt diff --git a/04-word-search/wordsearch01.txt b/10-word-search/wordsearch01.txt similarity index 100% rename from 04-word-search/wordsearch01.txt rename to 10-word-search/wordsearch01.txt diff --git a/04-word-search/wordsearch02.txt b/10-word-search/wordsearch02.txt similarity index 100% rename from 04-word-search/wordsearch02.txt rename to 10-word-search/wordsearch02.txt diff --git a/04-word-search/wordsearch03.txt b/10-word-search/wordsearch03.txt similarity index 100% rename from 04-word-search/wordsearch03.txt rename to 10-word-search/wordsearch03.txt diff --git a/04-word-search/wordsearch04.txt b/10-word-search/wordsearch04.txt similarity index 100% rename from 04-word-search/wordsearch04.txt rename to 10-word-search/wordsearch04.txt diff --git a/04-word-search/wordsearch05.txt b/10-word-search/wordsearch05.txt similarity index 100% rename from 04-word-search/wordsearch05.txt rename to 10-word-search/wordsearch05.txt diff --git a/04-word-search/wordsearch06.txt b/10-word-search/wordsearch06.txt similarity index 100% rename from 04-word-search/wordsearch06.txt rename to 10-word-search/wordsearch06.txt diff --git a/04-word-search/wordsearch07.txt b/10-word-search/wordsearch07.txt similarity index 100% rename from 04-word-search/wordsearch07.txt rename to 10-word-search/wordsearch07.txt diff --git a/04-word-search/wordsearch08.txt b/10-word-search/wordsearch08.txt similarity index 100% rename from 04-word-search/wordsearch08.txt rename to 10-word-search/wordsearch08.txt diff --git a/04-word-search/wordsearch09.txt b/10-word-search/wordsearch09.txt similarity index 100% rename from 04-word-search/wordsearch09.txt rename to 10-word-search/wordsearch09.txt diff --git a/04-word-search/wordsearch10.txt b/10-word-search/wordsearch10.txt similarity index 100% rename from 04-word-search/wordsearch10.txt rename to 10-word-search/wordsearch10.txt diff --git a/04-word-search/wordsearch11.txt b/10-word-search/wordsearch11.txt similarity index 100% rename from 04-word-search/wordsearch11.txt rename to 10-word-search/wordsearch11.txt diff --git a/04-word-search/wordsearch12.txt b/10-word-search/wordsearch12.txt similarity index 100% rename from 04-word-search/wordsearch12.txt rename to 10-word-search/wordsearch12.txt diff --git a/04-word-search/wordsearch13.txt b/10-word-search/wordsearch13.txt similarity index 100% rename from 04-word-search/wordsearch13.txt rename to 10-word-search/wordsearch13.txt diff --git a/04-word-search/wordsearch14.txt b/10-word-search/wordsearch14.txt similarity index 100% rename from 04-word-search/wordsearch14.txt rename to 10-word-search/wordsearch14.txt diff --git a/04-word-search/wordsearch15.txt b/10-word-search/wordsearch15.txt similarity index 100% rename from 04-word-search/wordsearch15.txt rename to 10-word-search/wordsearch15.txt diff --git a/04-word-search/wordsearch16.txt b/10-word-search/wordsearch16.txt similarity index 100% rename from 04-word-search/wordsearch16.txt rename to 10-word-search/wordsearch16.txt diff --git a/04-word-search/wordsearch17.txt b/10-word-search/wordsearch17.txt similarity index 100% rename from 04-word-search/wordsearch17.txt rename to 10-word-search/wordsearch17.txt diff --git a/04-word-search/wordsearch18.txt b/10-word-search/wordsearch18.txt similarity index 100% rename from 04-word-search/wordsearch18.txt rename to 10-word-search/wordsearch18.txt diff --git a/04-word-search/wordsearch19.txt b/10-word-search/wordsearch19.txt similarity index 100% rename from 04-word-search/wordsearch19.txt rename to 10-word-search/wordsearch19.txt diff --git a/04-word-search/wordsearch20.txt b/10-word-search/wordsearch20.txt similarity index 100% rename from 04-word-search/wordsearch20.txt rename to 10-word-search/wordsearch20.txt diff --git a/04-word-search/wordsearch21.txt b/10-word-search/wordsearch21.txt similarity index 100% rename from 04-word-search/wordsearch21.txt rename to 10-word-search/wordsearch21.txt diff --git a/04-word-search/wordsearch22.txt b/10-word-search/wordsearch22.txt similarity index 100% rename from 04-word-search/wordsearch22.txt rename to 10-word-search/wordsearch22.txt diff --git a/04-word-search/wordsearch23.txt b/10-word-search/wordsearch23.txt similarity index 100% rename from 04-word-search/wordsearch23.txt rename to 10-word-search/wordsearch23.txt diff --git a/04-word-search/wordsearch24.txt b/10-word-search/wordsearch24.txt similarity index 100% rename from 04-word-search/wordsearch24.txt rename to 10-word-search/wordsearch24.txt diff --git a/04-word-search/wordsearch25.txt b/10-word-search/wordsearch25.txt similarity index 100% rename from 04-word-search/wordsearch25.txt rename to 10-word-search/wordsearch25.txt diff --git a/04-word-search/wordsearch26.txt b/10-word-search/wordsearch26.txt similarity index 100% rename from 04-word-search/wordsearch26.txt rename to 10-word-search/wordsearch26.txt diff --git a/04-word-search/wordsearch27.txt b/10-word-search/wordsearch27.txt similarity index 100% rename from 04-word-search/wordsearch27.txt rename to 10-word-search/wordsearch27.txt diff --git a/04-word-search/wordsearch28.txt b/10-word-search/wordsearch28.txt similarity index 100% rename from 04-word-search/wordsearch28.txt rename to 10-word-search/wordsearch28.txt diff --git a/04-word-search/wordsearch29.txt b/10-word-search/wordsearch29.txt similarity index 100% rename from 04-word-search/wordsearch29.txt rename to 10-word-search/wordsearch29.txt diff --git a/04-word-search/wordsearch30.txt b/10-word-search/wordsearch30.txt similarity index 100% rename from 04-word-search/wordsearch30.txt rename to 10-word-search/wordsearch30.txt diff --git a/04-word-search/wordsearch31.txt b/10-word-search/wordsearch31.txt similarity index 100% rename from 04-word-search/wordsearch31.txt rename to 10-word-search/wordsearch31.txt diff --git a/04-word-search/wordsearch32.txt b/10-word-search/wordsearch32.txt similarity index 100% rename from 04-word-search/wordsearch32.txt rename to 10-word-search/wordsearch32.txt diff --git a/04-word-search/wordsearch33.txt b/10-word-search/wordsearch33.txt similarity index 100% rename from 04-word-search/wordsearch33.txt rename to 10-word-search/wordsearch33.txt diff --git a/04-word-search/wordsearch34.txt b/10-word-search/wordsearch34.txt similarity index 100% rename from 04-word-search/wordsearch34.txt rename to 10-word-search/wordsearch34.txt diff --git a/04-word-search/wordsearch35.txt b/10-word-search/wordsearch35.txt similarity index 100% rename from 04-word-search/wordsearch35.txt rename to 10-word-search/wordsearch35.txt diff --git a/04-word-search/wordsearch36.txt b/10-word-search/wordsearch36.txt similarity index 100% rename from 04-word-search/wordsearch36.txt rename to 10-word-search/wordsearch36.txt diff --git a/04-word-search/wordsearch37.txt b/10-word-search/wordsearch37.txt similarity index 100% rename from 04-word-search/wordsearch37.txt rename to 10-word-search/wordsearch37.txt diff --git a/04-word-search/wordsearch38.txt b/10-word-search/wordsearch38.txt similarity index 100% rename from 04-word-search/wordsearch38.txt rename to 10-word-search/wordsearch38.txt diff --git a/04-word-search/wordsearch39.txt b/10-word-search/wordsearch39.txt similarity index 100% rename from 04-word-search/wordsearch39.txt rename to 10-word-search/wordsearch39.txt diff --git a/04-word-search/wordsearch40.txt b/10-word-search/wordsearch40.txt similarity index 100% rename from 04-word-search/wordsearch40.txt rename to 10-word-search/wordsearch40.txt diff --git a/04-word-search/wordsearch41.txt b/10-word-search/wordsearch41.txt similarity index 100% rename from 04-word-search/wordsearch41.txt rename to 10-word-search/wordsearch41.txt diff --git a/04-word-search/wordsearch42.txt b/10-word-search/wordsearch42.txt similarity index 100% rename from 04-word-search/wordsearch42.txt rename to 10-word-search/wordsearch42.txt diff --git a/04-word-search/wordsearch43.txt b/10-word-search/wordsearch43.txt similarity index 100% rename from 04-word-search/wordsearch43.txt rename to 10-word-search/wordsearch43.txt diff --git a/04-word-search/wordsearch44.txt b/10-word-search/wordsearch44.txt similarity index 100% rename from 04-word-search/wordsearch44.txt rename to 10-word-search/wordsearch44.txt diff --git a/04-word-search/wordsearch45.txt b/10-word-search/wordsearch45.txt similarity index 100% rename from 04-word-search/wordsearch45.txt rename to 10-word-search/wordsearch45.txt diff --git a/04-word-search/wordsearch46.txt b/10-word-search/wordsearch46.txt similarity index 100% rename from 04-word-search/wordsearch46.txt rename to 10-word-search/wordsearch46.txt diff --git a/04-word-search/wordsearch47.txt b/10-word-search/wordsearch47.txt similarity index 100% rename from 04-word-search/wordsearch47.txt rename to 10-word-search/wordsearch47.txt diff --git a/04-word-search/wordsearch48.txt b/10-word-search/wordsearch48.txt similarity index 100% rename from 04-word-search/wordsearch48.txt rename to 10-word-search/wordsearch48.txt diff --git a/04-word-search/wordsearch49.txt b/10-word-search/wordsearch49.txt similarity index 100% rename from 04-word-search/wordsearch49.txt rename to 10-word-search/wordsearch49.txt diff --git a/04-word-search/wordsearch50.txt b/10-word-search/wordsearch50.txt similarity index 100% rename from 04-word-search/wordsearch50.txt rename to 10-word-search/wordsearch50.txt diff --git a/04-word-search/wordsearch51.txt b/10-word-search/wordsearch51.txt similarity index 100% rename from 04-word-search/wordsearch51.txt rename to 10-word-search/wordsearch51.txt diff --git a/04-word-search/wordsearch52.txt b/10-word-search/wordsearch52.txt similarity index 100% rename from 04-word-search/wordsearch52.txt rename to 10-word-search/wordsearch52.txt diff --git a/04-word-search/wordsearch53.txt b/10-word-search/wordsearch53.txt similarity index 100% rename from 04-word-search/wordsearch53.txt rename to 10-word-search/wordsearch53.txt diff --git a/04-word-search/wordsearch54.txt b/10-word-search/wordsearch54.txt similarity index 100% rename from 04-word-search/wordsearch54.txt rename to 10-word-search/wordsearch54.txt diff --git a/04-word-search/wordsearch55.txt b/10-word-search/wordsearch55.txt similarity index 100% rename from 04-word-search/wordsearch55.txt rename to 10-word-search/wordsearch55.txt diff --git a/04-word-search/wordsearch56.txt b/10-word-search/wordsearch56.txt similarity index 100% rename from 04-word-search/wordsearch56.txt rename to 10-word-search/wordsearch56.txt diff --git a/04-word-search/wordsearch57.txt b/10-word-search/wordsearch57.txt similarity index 100% rename from 04-word-search/wordsearch57.txt rename to 10-word-search/wordsearch57.txt diff --git a/04-word-search/wordsearch58.txt b/10-word-search/wordsearch58.txt similarity index 100% rename from 04-word-search/wordsearch58.txt rename to 10-word-search/wordsearch58.txt diff --git a/04-word-search/wordsearch59.txt b/10-word-search/wordsearch59.txt similarity index 100% rename from 04-word-search/wordsearch59.txt rename to 10-word-search/wordsearch59.txt diff --git a/04-word-search/wordsearch60.txt b/10-word-search/wordsearch60.txt similarity index 100% rename from 04-word-search/wordsearch60.txt rename to 10-word-search/wordsearch60.txt diff --git a/04-word-search/wordsearch61.txt b/10-word-search/wordsearch61.txt similarity index 100% rename from 04-word-search/wordsearch61.txt rename to 10-word-search/wordsearch61.txt diff --git a/04-word-search/wordsearch62.txt b/10-word-search/wordsearch62.txt similarity index 100% rename from 04-word-search/wordsearch62.txt rename to 10-word-search/wordsearch62.txt diff --git a/04-word-search/wordsearch63.txt b/10-word-search/wordsearch63.txt similarity index 100% rename from 04-word-search/wordsearch63.txt rename to 10-word-search/wordsearch63.txt diff --git a/04-word-search/wordsearch64.txt b/10-word-search/wordsearch64.txt similarity index 100% rename from 04-word-search/wordsearch64.txt rename to 10-word-search/wordsearch64.txt diff --git a/04-word-search/wordsearch65.txt b/10-word-search/wordsearch65.txt similarity index 100% rename from 04-word-search/wordsearch65.txt rename to 10-word-search/wordsearch65.txt diff --git a/04-word-search/wordsearch66.txt b/10-word-search/wordsearch66.txt similarity index 100% rename from 04-word-search/wordsearch66.txt rename to 10-word-search/wordsearch66.txt diff --git a/04-word-search/wordsearch67.txt b/10-word-search/wordsearch67.txt similarity index 100% rename from 04-word-search/wordsearch67.txt rename to 10-word-search/wordsearch67.txt diff --git a/04-word-search/wordsearch68.txt b/10-word-search/wordsearch68.txt similarity index 100% rename from 04-word-search/wordsearch68.txt rename to 10-word-search/wordsearch68.txt diff --git a/04-word-search/wordsearch69.txt b/10-word-search/wordsearch69.txt similarity index 100% rename from 04-word-search/wordsearch69.txt rename to 10-word-search/wordsearch69.txt diff --git a/04-word-search/wordsearch70.txt b/10-word-search/wordsearch70.txt similarity index 100% rename from 04-word-search/wordsearch70.txt rename to 10-word-search/wordsearch70.txt diff --git a/04-word-search/wordsearch71.txt b/10-word-search/wordsearch71.txt similarity index 100% rename from 04-word-search/wordsearch71.txt rename to 10-word-search/wordsearch71.txt diff --git a/04-word-search/wordsearch72.txt b/10-word-search/wordsearch72.txt similarity index 100% rename from 04-word-search/wordsearch72.txt rename to 10-word-search/wordsearch72.txt diff --git a/04-word-search/wordsearch73.txt b/10-word-search/wordsearch73.txt similarity index 100% rename from 04-word-search/wordsearch73.txt rename to 10-word-search/wordsearch73.txt diff --git a/04-word-search/wordsearch74.txt b/10-word-search/wordsearch74.txt similarity index 100% rename from 04-word-search/wordsearch74.txt rename to 10-word-search/wordsearch74.txt diff --git a/04-word-search/wordsearch75.txt b/10-word-search/wordsearch75.txt similarity index 100% rename from 04-word-search/wordsearch75.txt rename to 10-word-search/wordsearch75.txt diff --git a/04-word-search/wordsearch76.txt b/10-word-search/wordsearch76.txt similarity index 100% rename from 04-word-search/wordsearch76.txt rename to 10-word-search/wordsearch76.txt diff --git a/04-word-search/wordsearch77.txt b/10-word-search/wordsearch77.txt similarity index 100% rename from 04-word-search/wordsearch77.txt rename to 10-word-search/wordsearch77.txt diff --git a/04-word-search/wordsearch78.txt b/10-word-search/wordsearch78.txt similarity index 100% rename from 04-word-search/wordsearch78.txt rename to 10-word-search/wordsearch78.txt diff --git a/04-word-search/wordsearch79.txt b/10-word-search/wordsearch79.txt similarity index 100% rename from 04-word-search/wordsearch79.txt rename to 10-word-search/wordsearch79.txt diff --git a/04-word-search/wordsearch80.txt b/10-word-search/wordsearch80.txt similarity index 100% rename from 04-word-search/wordsearch80.txt rename to 10-word-search/wordsearch80.txt diff --git a/04-word-search/wordsearch81.txt b/10-word-search/wordsearch81.txt similarity index 100% rename from 04-word-search/wordsearch81.txt rename to 10-word-search/wordsearch81.txt diff --git a/04-word-search/wordsearch82.txt b/10-word-search/wordsearch82.txt similarity index 100% rename from 04-word-search/wordsearch82.txt rename to 10-word-search/wordsearch82.txt diff --git a/04-word-search/wordsearch83.txt b/10-word-search/wordsearch83.txt similarity index 100% rename from 04-word-search/wordsearch83.txt rename to 10-word-search/wordsearch83.txt diff --git a/04-word-search/wordsearch84.txt b/10-word-search/wordsearch84.txt similarity index 100% rename from 04-word-search/wordsearch84.txt rename to 10-word-search/wordsearch84.txt diff --git a/04-word-search/wordsearch85.txt b/10-word-search/wordsearch85.txt similarity index 100% rename from 04-word-search/wordsearch85.txt rename to 10-word-search/wordsearch85.txt diff --git a/04-word-search/wordsearch86.txt b/10-word-search/wordsearch86.txt similarity index 100% rename from 04-word-search/wordsearch86.txt rename to 10-word-search/wordsearch86.txt diff --git a/04-word-search/wordsearch87.txt b/10-word-search/wordsearch87.txt similarity index 100% rename from 04-word-search/wordsearch87.txt rename to 10-word-search/wordsearch87.txt diff --git a/04-word-search/wordsearch88.txt b/10-word-search/wordsearch88.txt similarity index 100% rename from 04-word-search/wordsearch88.txt rename to 10-word-search/wordsearch88.txt diff --git a/04-word-search/wordsearch89.txt b/10-word-search/wordsearch89.txt similarity index 100% rename from 04-word-search/wordsearch89.txt rename to 10-word-search/wordsearch89.txt diff --git a/04-word-search/wordsearch90.txt b/10-word-search/wordsearch90.txt similarity index 100% rename from 04-word-search/wordsearch90.txt rename to 10-word-search/wordsearch90.txt diff --git a/04-word-search/wordsearch91.txt b/10-word-search/wordsearch91.txt similarity index 100% rename from 04-word-search/wordsearch91.txt rename to 10-word-search/wordsearch91.txt diff --git a/04-word-search/wordsearch92.txt b/10-word-search/wordsearch92.txt similarity index 100% rename from 04-word-search/wordsearch92.txt rename to 10-word-search/wordsearch92.txt diff --git a/04-word-search/wordsearch93.txt b/10-word-search/wordsearch93.txt similarity index 100% rename from 04-word-search/wordsearch93.txt rename to 10-word-search/wordsearch93.txt diff --git a/04-word-search/wordsearch94.txt b/10-word-search/wordsearch94.txt similarity index 100% rename from 04-word-search/wordsearch94.txt rename to 10-word-search/wordsearch94.txt diff --git a/04-word-search/wordsearch95.txt b/10-word-search/wordsearch95.txt similarity index 100% rename from 04-word-search/wordsearch95.txt rename to 10-word-search/wordsearch95.txt diff --git a/04-word-search/wordsearch96.txt b/10-word-search/wordsearch96.txt similarity index 100% rename from 04-word-search/wordsearch96.txt rename to 10-word-search/wordsearch96.txt diff --git a/04-word-search/wordsearch97.txt b/10-word-search/wordsearch97.txt similarity index 100% rename from 04-word-search/wordsearch97.txt rename to 10-word-search/wordsearch97.txt diff --git a/04-word-search/wordsearch98.txt b/10-word-search/wordsearch98.txt similarity index 100% rename from 04-word-search/wordsearch98.txt rename to 10-word-search/wordsearch98.txt diff --git a/04-word-search/wordsearch99.txt b/10-word-search/wordsearch99.txt similarity index 100% rename from 04-word-search/wordsearch99.txt rename to 10-word-search/wordsearch99.txt diff --git a/problem-ideas.ipynb b/problem-ideas.ipynb index f865390..23517df 100644 --- a/problem-ideas.ipynb +++ b/problem-ideas.ipynb @@ -18,13 +18,15 @@ "1. [Ticket prices](01-ticket-prices)\n", "2. [Lift instructions](02-lifts)\n", "3. [Door codes](03-door-codes)\n", - "4. [Word search](04-word-search)\n", + "4. [Ghost leg, follow and pack](04-amidakuji)\n", "5. [Display board](05-display-board)\n", "6. [Tour shapes](06-tour-shapes) [Problem B](https://www.cs.uoregon.edu/Activities/Luks_Programming_Contest/problems/Problems2017.pdf): A is check if string is a closed loop, B is find the area\n", - "7. [Activity network](07-activity-network)\n", + "7. [Ghost leg, simplify]()\n", + "7. [Virtual machine]()\n", "8. [Filling the days](08-filling-days) [Problem C](https://www.cs.uoregon.edu/Activities/Luks_Programming_Contest/problems/Problems2017.pdf): A per the problem, B when there are multiple rooms available\n", "9. [Word chains](09-word-chains)\n", - "10. [Suitcase packing](10-suitacase-packing)\n" + "10. [Suitcase packing](10-suitacase-packing)\n", + "11. [Word search](04-word-search)\n" ] }, { @@ -290,7 +292,8 @@ "- Clojure\n", "- Lua\n", "- JavaScript\n", - "- Java" + "- Java\n", + "- Dart" ] }, { -- 2.34.1