This repo is not current. Development has moved from Hg to Git. For the latest code use the "Source Code" tab above to go to the "Thun" git repo or navigate to:
https://osdn.net/projects/joypy/scm/git/Thun
Révision | ab34fee54595f4d0e91b928ecd4c4d38840848e2 (tree) |
---|---|
l'heure | 2020-06-03 23:52:21 |
Auteur | ![]() |
Commiter | Simon Forman |
Added a page to the docs.
Advent_of_Code_2017_December_1st a simple example.
@@ -13077,7 +13077,9 @@ | ||
13077 | 13077 | <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> |
13078 | 13078 | </div><div class="inner_cell"> |
13079 | 13079 | <div class="text_cell_render border-box-sizing rendered_html"> |
13080 | -<h1 id="Advent-of-Code-2017">Advent of Code 2017<a class="anchor-link" href="#Advent-of-Code-2017">¶</a></h1><h2 id="December-1st">December 1st<a class="anchor-link" href="#December-1st">¶</a></h2><p>[Given] a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list.</p> | |
13080 | +<h1 id="Joy-Example-Code">Joy Example Code<a class="anchor-link" href="#Joy-Example-Code">¶</a></h1><p>A brief example of Joy programming from the <a href="https://adventofcode.com/2017/day/1">Advent of Code 2017, December 1st puzzle</a>.</p> | |
13081 | +<blockquote><p>Given a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list.</p> | |
13082 | +</blockquote> | |
13081 | 13083 | <p>For example:</p> |
13082 | 13084 | <ul> |
13083 | 13085 | <li>1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit.</li> |
@@ -13094,7 +13096,7 @@ | ||
13094 | 13096 | <div class="prompt input_prompt">In [1]:</div> |
13095 | 13097 | <div class="inner_cell"> |
13096 | 13098 | <div class="input_area"> |
13097 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="kn">from</span> <span class="nn">notebook_preamble</span> <span class="kn">import</span> <span class="n">J</span><span class="p">,</span> <span class="n">V</span><span class="p">,</span> <span class="n">define</span> | |
13099 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="kn">from</span> <span class="nn">notebook_preamble</span> <span class="kn">import</span> <span class="n">J</span><span class="p">,</span> <span class="n">V</span><span class="p">,</span> <span class="n">define</span> | |
13098 | 13100 | </pre></div> |
13099 | 13101 | |
13100 | 13102 | </div> |
@@ -13139,7 +13141,7 @@ | ||
13139 | 13141 | <div class="prompt input_prompt">In [2]:</div> |
13140 | 13142 | <div class="inner_cell"> |
13141 | 13143 | <div class="input_area"> |
13142 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'pair_up == dup uncons swap unit concat zip'</span><span class="p">)</span> | |
13144 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'pair_up dup uncons swap unit concat zip'</span><span class="p">)</span> | |
13143 | 13145 | </pre></div> |
13144 | 13146 | |
13145 | 13147 | </div> |
@@ -13152,7 +13154,7 @@ | ||
13152 | 13154 | <div class="prompt input_prompt">In [3]:</div> |
13153 | 13155 | <div class="inner_cell"> |
13154 | 13156 | <div class="input_area"> |
13155 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3] pair_up'</span><span class="p">)</span> | |
13157 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3] pair_up'</span><span class="p">)</span> | |
13156 | 13158 | </pre></div> |
13157 | 13159 | |
13158 | 13160 | </div> |
@@ -13183,7 +13185,7 @@ | ||
13183 | 13185 | <div class="prompt input_prompt">In [4]:</div> |
13184 | 13186 | <div class="inner_cell"> |
13185 | 13187 | <div class="input_area"> |
13186 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 2 3] pair_up'</span><span class="p">)</span> | |
13188 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 2 3] pair_up'</span><span class="p">)</span> | |
13187 | 13189 | </pre></div> |
13188 | 13190 | |
13189 | 13191 | </div> |
@@ -13251,7 +13253,7 @@ | ||
13251 | 13253 | <div class="prompt input_prompt">In [5]:</div> |
13252 | 13254 | <div class="inner_cell"> |
13253 | 13255 | <div class="input_area"> |
13254 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'total_matches == 0 swap [i [=] [pop +] [popop] ifte] step'</span><span class="p">)</span> | |
13256 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'total_matches 0 swap [i [=] [pop +] [popop] ifte] step'</span><span class="p">)</span> | |
13255 | 13257 | </pre></div> |
13256 | 13258 | |
13257 | 13259 | </div> |
@@ -13264,7 +13266,7 @@ | ||
13264 | 13266 | <div class="prompt input_prompt">In [6]:</div> |
13265 | 13267 | <div class="inner_cell"> |
13266 | 13268 | <div class="input_area"> |
13267 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3] pair_up total_matches'</span><span class="p">)</span> | |
13269 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3] pair_up total_matches'</span><span class="p">)</span> | |
13268 | 13270 | </pre></div> |
13269 | 13271 | |
13270 | 13272 | </div> |
@@ -13295,7 +13297,7 @@ | ||
13295 | 13297 | <div class="prompt input_prompt">In [7]:</div> |
13296 | 13298 | <div class="inner_cell"> |
13297 | 13299 | <div class="input_area"> |
13298 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 2 3] pair_up total_matches'</span><span class="p">)</span> | |
13300 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 2 3] pair_up total_matches'</span><span class="p">)</span> | |
13299 | 13301 | </pre></div> |
13300 | 13302 | |
13301 | 13303 | </div> |
@@ -13334,7 +13336,7 @@ | ||
13334 | 13336 | <div class="prompt input_prompt">In [8]:</div> |
13335 | 13337 | <div class="inner_cell"> |
13336 | 13338 | <div class="input_area"> |
13337 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'AoC2017.1 == pair_up total_matches'</span><span class="p">)</span> | |
13339 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'AoC2017.1 pair_up total_matches'</span><span class="p">)</span> | |
13338 | 13340 | </pre></div> |
13339 | 13341 | |
13340 | 13342 | </div> |
@@ -13347,7 +13349,7 @@ | ||
13347 | 13349 | <div class="prompt input_prompt">In [9]:</div> |
13348 | 13350 | <div class="inner_cell"> |
13349 | 13351 | <div class="input_area"> |
13350 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 1 2 2] AoC2017.1'</span><span class="p">)</span> | |
13352 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 1 2 2] AoC2017.1'</span><span class="p">)</span> | |
13351 | 13353 | </pre></div> |
13352 | 13354 | |
13353 | 13355 | </div> |
@@ -13378,7 +13380,7 @@ | ||
13378 | 13380 | <div class="prompt input_prompt">In [10]:</div> |
13379 | 13381 | <div class="inner_cell"> |
13380 | 13382 | <div class="input_area"> |
13381 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 1 1 1] AoC2017.1'</span><span class="p">)</span> | |
13383 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 1 1 1] AoC2017.1'</span><span class="p">)</span> | |
13382 | 13384 | </pre></div> |
13383 | 13385 | |
13384 | 13386 | </div> |
@@ -13409,7 +13411,7 @@ | ||
13409 | 13411 | <div class="prompt input_prompt">In [11]:</div> |
13410 | 13412 | <div class="inner_cell"> |
13411 | 13413 | <div class="input_area"> |
13412 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4] AoC2017.1'</span><span class="p">)</span> | |
13414 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4] AoC2017.1'</span><span class="p">)</span> | |
13413 | 13415 | </pre></div> |
13414 | 13416 | |
13415 | 13417 | </div> |
@@ -13440,38 +13442,7 @@ | ||
13440 | 13442 | <div class="prompt input_prompt">In [12]:</div> |
13441 | 13443 | <div class="inner_cell"> |
13442 | 13444 | <div class="input_area"> |
13443 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[9 1 2 1 2 1 2 9] AoC2017.1'</span><span class="p">)</span> | |
13444 | -</pre></div> | |
13445 | - | |
13446 | - </div> | |
13447 | -</div> | |
13448 | -</div> | |
13449 | - | |
13450 | -<div class="output_wrapper"> | |
13451 | -<div class="output"> | |
13452 | - | |
13453 | - | |
13454 | -<div class="output_area"> | |
13455 | - | |
13456 | - <div class="prompt"></div> | |
13457 | - | |
13458 | - | |
13459 | -<div class="output_subarea output_stream output_stdout output_text"> | |
13460 | -<pre>9 | |
13461 | -</pre> | |
13462 | -</div> | |
13463 | -</div> | |
13464 | - | |
13465 | -</div> | |
13466 | -</div> | |
13467 | - | |
13468 | -</div> | |
13469 | -<div class="cell border-box-sizing code_cell rendered"> | |
13470 | -<div class="input"> | |
13471 | -<div class="prompt input_prompt">In [13]:</div> | |
13472 | -<div class="inner_cell"> | |
13473 | - <div class="input_area"> | |
13474 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[9 1 2 1 2 1 2 9] AoC2017.1'</span><span class="p">)</span> | |
13445 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[9 1 2 1 2 1 2 9] AoC2017.1'</span><span class="p">)</span> | |
13475 | 13446 | </pre></div> |
13476 | 13447 | |
13477 | 13448 | </div> |
@@ -13509,18 +13480,12 @@ | ||
13509 | 13480 | </div> |
13510 | 13481 | </div> |
13511 | 13482 | </div> |
13512 | -<div class="cell border-box-sizing code_cell rendered"> | |
13513 | -<div class="input"> | |
13514 | -<div class="prompt input_prompt">In [ ]:</div> | |
13515 | -<div class="inner_cell"> | |
13516 | - <div class="input_area"> | |
13517 | -<div class=" highlight hl-ipython2"><pre><span></span> | |
13518 | -</pre></div> | |
13519 | - | |
13520 | - </div> | |
13521 | -</div> | |
13522 | -</div> | |
13523 | - | |
13483 | +<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> | |
13484 | +</div><div class="inner_cell"> | |
13485 | +<div class="text_cell_render border-box-sizing rendered_html"> | |
13486 | +<h2 id="Next-Part-of-the-Challenge">Next Part of the Challenge<a class="anchor-link" href="#Next-Part-of-the-Challenge">¶</a></h2> | |
13487 | +</div> | |
13488 | +</div> | |
13524 | 13489 | </div> |
13525 | 13490 | <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> |
13526 | 13491 | </div><div class="inner_cell"> |
@@ -13534,10 +13499,10 @@ | ||
13534 | 13499 | </div> |
13535 | 13500 | <div class="cell border-box-sizing code_cell rendered"> |
13536 | 13501 | <div class="input"> |
13537 | -<div class="prompt input_prompt">In [14]:</div> | |
13502 | +<div class="prompt input_prompt">In [13]:</div> | |
13538 | 13503 | <div class="inner_cell"> |
13539 | 13504 | <div class="input_area"> |
13540 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4] dup size 2 / [drop] [take reverse] cleave concat zip'</span><span class="p">)</span> | |
13505 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4] dup size 2 / [drop] [take reverse] cleave concat zip'</span><span class="p">)</span> | |
13541 | 13506 | </pre></div> |
13542 | 13507 | |
13543 | 13508 | </div> |
@@ -13573,10 +13538,10 @@ | ||
13573 | 13538 | </div> |
13574 | 13539 | <div class="cell border-box-sizing code_cell rendered"> |
13575 | 13540 | <div class="input"> |
13576 | -<div class="prompt input_prompt">In [15]:</div> | |
13541 | +<div class="prompt input_prompt">In [14]:</div> | |
13577 | 13542 | <div class="inner_cell"> |
13578 | 13543 | <div class="input_area"> |
13579 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4] dup size 2 / [drop] [take reverse] cleave zip'</span><span class="p">)</span> | |
13544 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4] dup size 2 / [drop] [take reverse] cleave zip'</span><span class="p">)</span> | |
13580 | 13545 | </pre></div> |
13581 | 13546 | |
13582 | 13547 | </div> |
@@ -13604,10 +13569,10 @@ | ||
13604 | 13569 | </div> |
13605 | 13570 | <div class="cell border-box-sizing code_cell rendered"> |
13606 | 13571 | <div class="input"> |
13607 | -<div class="prompt input_prompt">In [16]:</div> | |
13572 | +<div class="prompt input_prompt">In [15]:</div> | |
13608 | 13573 | <div class="inner_cell"> |
13609 | 13574 | <div class="input_area"> |
13610 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'AoC2017.1.extra == dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *'</span><span class="p">)</span> | |
13575 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">define</span><span class="p">(</span><span class="s1">'AoC2017.1.extra dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *'</span><span class="p">)</span> | |
13611 | 13576 | </pre></div> |
13612 | 13577 | |
13613 | 13578 | </div> |
@@ -13617,10 +13582,10 @@ | ||
13617 | 13582 | </div> |
13618 | 13583 | <div class="cell border-box-sizing code_cell rendered"> |
13619 | 13584 | <div class="input"> |
13620 | -<div class="prompt input_prompt">In [17]:</div> | |
13585 | +<div class="prompt input_prompt">In [16]:</div> | |
13621 | 13586 | <div class="inner_cell"> |
13622 | 13587 | <div class="input_area"> |
13623 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 1 2] AoC2017.1.extra'</span><span class="p">)</span> | |
13588 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 1 2] AoC2017.1.extra'</span><span class="p">)</span> | |
13624 | 13589 | </pre></div> |
13625 | 13590 | |
13626 | 13591 | </div> |
@@ -13648,10 +13613,10 @@ | ||
13648 | 13613 | </div> |
13649 | 13614 | <div class="cell border-box-sizing code_cell rendered"> |
13650 | 13615 | <div class="input"> |
13651 | -<div class="prompt input_prompt">In [18]:</div> | |
13616 | +<div class="prompt input_prompt">In [17]:</div> | |
13652 | 13617 | <div class="inner_cell"> |
13653 | 13618 | <div class="input_area"> |
13654 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 2 1] AoC2017.1.extra'</span><span class="p">)</span> | |
13619 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 2 1] AoC2017.1.extra'</span><span class="p">)</span> | |
13655 | 13620 | </pre></div> |
13656 | 13621 | |
13657 | 13622 | </div> |
@@ -13679,10 +13644,10 @@ | ||
13679 | 13644 | </div> |
13680 | 13645 | <div class="cell border-box-sizing code_cell rendered"> |
13681 | 13646 | <div class="input"> |
13682 | -<div class="prompt input_prompt">In [19]:</div> | |
13647 | +<div class="prompt input_prompt">In [18]:</div> | |
13683 | 13648 | <div class="inner_cell"> |
13684 | 13649 | <div class="input_area"> |
13685 | -<div class=" highlight hl-ipython2"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4 2 5] AoC2017.1.extra'</span><span class="p">)</span> | |
13650 | +<div class=" highlight hl-ipython3"><pre><span></span><span class="n">J</span><span class="p">(</span><span class="s1">'[1 2 3 4 2 5] AoC2017.1.extra'</span><span class="p">)</span> | |
13686 | 13651 | </pre></div> |
13687 | 13652 | |
13688 | 13653 | </div> |
@@ -4,11 +4,11 @@ | ||
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | - "# Advent of Code 2017\n", | |
7 | + "# Joy Example Code\n", | |
8 | 8 | "\n", |
9 | - "## December 1st\n", | |
9 | + "A brief example of Joy programming from the [Advent of Code 2017, December 1st puzzle](https://adventofcode.com/2017/day/1).\n", | |
10 | 10 | "\n", |
11 | - "\\[Given\\] a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list.\n", | |
11 | + "> Given a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list.\n", | |
12 | 12 | "\n", |
13 | 13 | "For example:\n", |
14 | 14 | "\n", |
@@ -63,7 +63,7 @@ | ||
63 | 63 | "metadata": {}, |
64 | 64 | "outputs": [], |
65 | 65 | "source": [ |
66 | - "define('pair_up == dup uncons swap unit concat zip')" | |
66 | + "define('pair_up dup uncons swap unit concat zip')" | |
67 | 67 | ] |
68 | 68 | }, |
69 | 69 | { |
@@ -139,7 +139,7 @@ | ||
139 | 139 | "metadata": {}, |
140 | 140 | "outputs": [], |
141 | 141 | "source": [ |
142 | - "define('total_matches == 0 swap [i [=] [pop +] [popop] ifte] step')" | |
142 | + "define('total_matches 0 swap [i [=] [pop +] [popop] ifte] step')" | |
143 | 143 | ] |
144 | 144 | }, |
145 | 145 | { |
@@ -189,7 +189,7 @@ | ||
189 | 189 | "metadata": {}, |
190 | 190 | "outputs": [], |
191 | 191 | "source": [ |
192 | - "define('AoC2017.1 == pair_up total_matches')" | |
192 | + "define('AoC2017.1 pair_up total_matches')" | |
193 | 193 | ] |
194 | 194 | }, |
195 | 195 | { |
@@ -263,25 +263,6 @@ | ||
263 | 263 | ] |
264 | 264 | }, |
265 | 265 | { |
266 | - "cell_type": "code", | |
267 | - "execution_count": 13, | |
268 | - "metadata": { | |
269 | - "scrolled": false | |
270 | - }, | |
271 | - "outputs": [ | |
272 | - { | |
273 | - "name": "stdout", | |
274 | - "output_type": "stream", | |
275 | - "text": [ | |
276 | - "9\n" | |
277 | - ] | |
278 | - } | |
279 | - ], | |
280 | - "source": [ | |
281 | - "J('[9 1 2 1 2 1 2 9] AoC2017.1')" | |
282 | - ] | |
283 | - }, | |
284 | - { | |
285 | 266 | "cell_type": "markdown", |
286 | 267 | "metadata": {}, |
287 | 268 | "source": [ |
@@ -292,11 +273,11 @@ | ||
292 | 273 | ] |
293 | 274 | }, |
294 | 275 | { |
295 | - "cell_type": "code", | |
296 | - "execution_count": null, | |
276 | + "cell_type": "markdown", | |
297 | 277 | "metadata": {}, |
298 | - "outputs": [], | |
299 | - "source": [] | |
278 | + "source": [ | |
279 | + "## Next Part of the Challenge" | |
280 | + ] | |
300 | 281 | }, |
301 | 282 | { |
302 | 283 | "cell_type": "markdown", |
@@ -309,7 +290,7 @@ | ||
309 | 290 | }, |
310 | 291 | { |
311 | 292 | "cell_type": "code", |
312 | - "execution_count": 14, | |
293 | + "execution_count": 13, | |
313 | 294 | "metadata": {}, |
314 | 295 | "outputs": [ |
315 | 296 | { |
@@ -333,7 +314,7 @@ | ||
333 | 314 | }, |
334 | 315 | { |
335 | 316 | "cell_type": "code", |
336 | - "execution_count": 15, | |
317 | + "execution_count": 14, | |
337 | 318 | "metadata": {}, |
338 | 319 | "outputs": [ |
339 | 320 | { |
@@ -350,16 +331,16 @@ | ||
350 | 331 | }, |
351 | 332 | { |
352 | 333 | "cell_type": "code", |
353 | - "execution_count": 16, | |
334 | + "execution_count": 15, | |
354 | 335 | "metadata": {}, |
355 | 336 | "outputs": [], |
356 | 337 | "source": [ |
357 | - "define('AoC2017.1.extra == dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *')" | |
338 | + "define('AoC2017.1.extra dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *')" | |
358 | 339 | ] |
359 | 340 | }, |
360 | 341 | { |
361 | 342 | "cell_type": "code", |
362 | - "execution_count": 17, | |
343 | + "execution_count": 16, | |
363 | 344 | "metadata": {}, |
364 | 345 | "outputs": [ |
365 | 346 | { |
@@ -376,7 +357,7 @@ | ||
376 | 357 | }, |
377 | 358 | { |
378 | 359 | "cell_type": "code", |
379 | - "execution_count": 18, | |
360 | + "execution_count": 17, | |
380 | 361 | "metadata": {}, |
381 | 362 | "outputs": [ |
382 | 363 | { |
@@ -393,7 +374,7 @@ | ||
393 | 374 | }, |
394 | 375 | { |
395 | 376 | "cell_type": "code", |
396 | - "execution_count": 19, | |
377 | + "execution_count": 18, | |
397 | 378 | "metadata": {}, |
398 | 379 | "outputs": [ |
399 | 380 | { |
@@ -440,14 +421,14 @@ | ||
440 | 421 | "language_info": { |
441 | 422 | "codemirror_mode": { |
442 | 423 | "name": "ipython", |
443 | - "version": 2 | |
424 | + "version": 3 | |
444 | 425 | }, |
445 | 426 | "file_extension": ".py", |
446 | 427 | "mimetype": "text/x-python", |
447 | 428 | "name": "python", |
448 | 429 | "nbconvert_exporter": "python", |
449 | - "pygments_lexer": "ipython2", | |
450 | - "version": "2.7.13" | |
430 | + "pygments_lexer": "ipython3", | |
431 | + "version": "3.8.3" | |
451 | 432 | } |
452 | 433 | }, |
453 | 434 | "nbformat": 4, |
@@ -1,8 +1,8 @@ | ||
1 | -# Advent of Code 2017 | |
1 | +# Joy Example Code | |
2 | 2 | |
3 | -## December 1st | |
3 | +A brief example of Joy programming from the [Advent of Code 2017, December 1st puzzle](https://adventofcode.com/2017/day/1). | |
4 | 4 | |
5 | -\[Given\] a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list. | |
5 | +> Given a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list. | |
6 | 6 | |
7 | 7 | For example: |
8 | 8 |
@@ -39,7 +39,7 @@ | ||
39 | 39 | |
40 | 40 | |
41 | 41 | ```python |
42 | -define('pair_up == dup uncons swap unit concat zip') | |
42 | +define('pair_up dup uncons swap unit concat zip') | |
43 | 43 | ``` |
44 | 44 | |
45 | 45 |
@@ -86,7 +86,7 @@ | ||
86 | 86 | |
87 | 87 | |
88 | 88 | ```python |
89 | -define('total_matches == 0 swap [i [=] [pop +] [popop] ifte] step') | |
89 | +define('total_matches 0 swap [i [=] [pop +] [popop] ifte] step') | |
90 | 90 | ``` |
91 | 91 | |
92 | 92 |
@@ -109,7 +109,7 @@ | ||
109 | 109 | |
110 | 110 | |
111 | 111 | ```python |
112 | -define('AoC2017.1 == pair_up total_matches') | |
112 | +define('AoC2017.1 pair_up total_matches') | |
113 | 113 | ``` |
114 | 114 | |
115 | 115 |
@@ -144,23 +144,12 @@ | ||
144 | 144 | 9 |
145 | 145 | |
146 | 146 | |
147 | - | |
148 | -```python | |
149 | -J('[9 1 2 1 2 1 2 9] AoC2017.1') | |
150 | -``` | |
151 | - | |
152 | - 9 | |
153 | - | |
154 | - | |
155 | 147 | pair_up == dup uncons swap unit concat zip |
156 | 148 | total_matches == 0 swap [i [=] [pop +] [popop] ifte] step |
157 | 149 | |
158 | 150 | AoC2017.1 == pair_up total_matches |
159 | 151 | |
160 | - | |
161 | -```python | |
162 | - | |
163 | -``` | |
152 | +## Next Part of the Challenge | |
164 | 153 | |
165 | 154 | Now the paired digit is "halfway" round. |
166 | 155 |
@@ -186,7 +175,7 @@ | ||
186 | 175 | |
187 | 176 | |
188 | 177 | ```python |
189 | -define('AoC2017.1.extra == dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *') | |
178 | +define('AoC2017.1.extra dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *') | |
190 | 179 | ``` |
191 | 180 | |
192 | 181 |
@@ -1,12 +1,13 @@ | ||
1 | -Advent of Code 2017 | |
2 | -=================== | |
1 | +Joy Example Code | |
2 | +================ | |
3 | 3 | |
4 | -December 1st | |
5 | ------------- | |
4 | +A brief example of Joy programming from the `Advent of Code 2017, | |
5 | +December 1st puzzle <https://adventofcode.com/2017/day/1>`__. | |
6 | 6 | |
7 | -[Given] a sequence of digits (your puzzle input) and find the sum of all | |
8 | -digits that match the next digit in the list. The list is circular, so | |
9 | -the digit after the last digit is the first digit in the list. | |
7 | + Given a sequence of digits (your puzzle input) and find the sum of | |
8 | + all digits that match the next digit in the list. The list is | |
9 | + circular, so the digit after the last digit is the first digit in | |
10 | + the list. | |
10 | 11 | |
11 | 12 | For example: |
12 | 13 |
@@ -17,7 +18,7 @@ | ||
17 | 18 | - 91212129 produces 9 because the only digit that matches the next one |
18 | 19 | is the last digit, 9. |
19 | 20 | |
20 | -.. code:: ipython2 | |
21 | +.. code:: ipython3 | |
21 | 22 | |
22 | 23 | from notebook_preamble import J, V, define |
23 | 24 |
@@ -52,11 +53,11 @@ | ||
52 | 53 | [a b c] [b c a] zip |
53 | 54 | [[b a] [c b] [a c]] |
54 | 55 | |
55 | -.. code:: ipython2 | |
56 | +.. code:: ipython3 | |
56 | 57 | |
57 | - define('pair_up == dup uncons swap unit concat zip') | |
58 | + define('pair_up dup uncons swap unit concat zip') | |
58 | 59 | |
59 | -.. code:: ipython2 | |
60 | +.. code:: ipython3 | |
60 | 61 | |
61 | 62 | J('[1 2 3] pair_up') |
62 | 63 |
@@ -66,7 +67,7 @@ | ||
66 | 67 | [[2 1] [3 2] [1 3]] |
67 | 68 | |
68 | 69 | |
69 | -.. code:: ipython2 | |
70 | +.. code:: ipython3 | |
70 | 71 | |
71 | 72 | J('[1 2 2 3] pair_up') |
72 | 73 |
@@ -115,11 +116,11 @@ | ||
115 | 116 | |
116 | 117 | total_matches == 0 swap [i [=] [pop +] [popop] ifte] step |
117 | 118 | |
118 | -.. code:: ipython2 | |
119 | +.. code:: ipython3 | |
119 | 120 | |
120 | - define('total_matches == 0 swap [i [=] [pop +] [popop] ifte] step') | |
121 | + define('total_matches 0 swap [i [=] [pop +] [popop] ifte] step') | |
121 | 122 | |
122 | -.. code:: ipython2 | |
123 | +.. code:: ipython3 | |
123 | 124 | |
124 | 125 | J('[1 2 3] pair_up total_matches') |
125 | 126 |
@@ -129,7 +130,7 @@ | ||
129 | 130 | 0 |
130 | 131 | |
131 | 132 | |
132 | -.. code:: ipython2 | |
133 | +.. code:: ipython3 | |
133 | 134 | |
134 | 135 | J('[1 2 2 3] pair_up total_matches') |
135 | 136 |
@@ -141,11 +142,11 @@ | ||
141 | 142 | |
142 | 143 | Now we can define our main program and evaluate it on the examples. |
143 | 144 | |
144 | -.. code:: ipython2 | |
145 | +.. code:: ipython3 | |
145 | 146 | |
146 | - define('AoC2017.1 == pair_up total_matches') | |
147 | + define('AoC2017.1 pair_up total_matches') | |
147 | 148 | |
148 | -.. code:: ipython2 | |
149 | +.. code:: ipython3 | |
149 | 150 | |
150 | 151 | J('[1 1 2 2] AoC2017.1') |
151 | 152 |
@@ -155,7 +156,7 @@ | ||
155 | 156 | 3 |
156 | 157 | |
157 | 158 | |
158 | -.. code:: ipython2 | |
159 | +.. code:: ipython3 | |
159 | 160 | |
160 | 161 | J('[1 1 1 1] AoC2017.1') |
161 | 162 |
@@ -165,7 +166,7 @@ | ||
165 | 166 | 4 |
166 | 167 | |
167 | 168 | |
168 | -.. code:: ipython2 | |
169 | +.. code:: ipython3 | |
169 | 170 | |
170 | 171 | J('[1 2 3 4] AoC2017.1') |
171 | 172 |
@@ -175,17 +176,7 @@ | ||
175 | 176 | 0 |
176 | 177 | |
177 | 178 | |
178 | -.. code:: ipython2 | |
179 | - | |
180 | - J('[9 1 2 1 2 1 2 9] AoC2017.1') | |
181 | - | |
182 | - | |
183 | -.. parsed-literal:: | |
184 | - | |
185 | - 9 | |
186 | - | |
187 | - | |
188 | -.. code:: ipython2 | |
179 | +.. code:: ipython3 | |
189 | 180 | |
190 | 181 | J('[9 1 2 1 2 1 2 9] AoC2017.1') |
191 | 182 |
@@ -202,6 +193,8 @@ | ||
202 | 193 | |
203 | 194 | AoC2017.1 == pair_up total_matches |
204 | 195 | |
196 | +Next Part of the Challenge | |
197 | +-------------------------- | |
205 | 198 | |
206 | 199 | Now the paired digit is "halfway" round. |
207 | 200 |
@@ -209,7 +202,7 @@ | ||
209 | 202 | |
210 | 203 | [a b c d] dup size 2 / [drop] [take reverse] cleave concat zip |
211 | 204 | |
212 | -.. code:: ipython2 | |
205 | +.. code:: ipython3 | |
213 | 206 | |
214 | 207 | J('[1 2 3 4] dup size 2 / [drop] [take reverse] cleave concat zip') |
215 | 208 |
@@ -221,7 +214,7 @@ | ||
221 | 214 | |
222 | 215 | I realized that each pair is repeated... |
223 | 216 | |
224 | -.. code:: ipython2 | |
217 | +.. code:: ipython3 | |
225 | 218 | |
226 | 219 | J('[1 2 3 4] dup size 2 / [drop] [take reverse] cleave zip') |
227 | 220 |
@@ -231,11 +224,11 @@ | ||
231 | 224 | [1 2 3 4] [[1 3] [2 4]] |
232 | 225 | |
233 | 226 | |
234 | -.. code:: ipython2 | |
227 | +.. code:: ipython3 | |
235 | 228 | |
236 | - define('AoC2017.1.extra == dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *') | |
229 | + define('AoC2017.1.extra dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *') | |
237 | 230 | |
238 | -.. code:: ipython2 | |
231 | +.. code:: ipython3 | |
239 | 232 | |
240 | 233 | J('[1 2 1 2] AoC2017.1.extra') |
241 | 234 |
@@ -245,7 +238,7 @@ | ||
245 | 238 | 6 |
246 | 239 | |
247 | 240 | |
248 | -.. code:: ipython2 | |
241 | +.. code:: ipython3 | |
249 | 242 | |
250 | 243 | J('[1 2 2 1] AoC2017.1.extra') |
251 | 244 |
@@ -255,7 +248,7 @@ | ||
255 | 248 | 0 |
256 | 249 | |
257 | 250 | |
258 | -.. code:: ipython2 | |
251 | +.. code:: ipython3 | |
259 | 252 | |
260 | 253 | J('[1 2 3 4 2 5] AoC2017.1.extra') |
261 | 254 |
@@ -23,7 +23,7 @@ | ||
23 | 23 | python -m nbconvert --to rst $< |
24 | 24 | |
25 | 25 | |
26 | -move_us = Derivatives_of_Regular_Expressions.rst Generator_Programs.rst Newton-Raphson.rst Ordered_Binary_Trees.rst Quadratic.rst Recursion_Combinators.rst Replacing.rst Square_Spiral.rst The_Four_Operations.rst Treestep.rst TypeChecking.rst Types.rst Zipper.rst | |
26 | +move_us = Advent_of_Code_2017_December_1st.rst Derivatives_of_Regular_Expressions.rst Generator_Programs.rst Newton-Raphson.rst Ordered_Binary_Trees.rst Quadratic.rst Recursion_Combinators.rst Replacing.rst Square_Spiral.rst The_Four_Operations.rst Treestep.rst TypeChecking.rst Types.rst Zipper.rst | |
27 | 27 | |
28 | 28 | mov: $(move_us) |
29 | 29 | cp -v $? ./sphinx_docs/notebooks/ |
@@ -163,6 +163,8 @@ | ||
163 | 163 | <li class="toctree-l2"><a class="reference internal" href="notebooks/Developing.html">Developing a Program in Joy</a></li> |
164 | 164 | <li class="toctree-l2"><a class="reference internal" href="notebooks/Quadratic.html">Quadratic formula</a></li> |
165 | 165 | <li class="toctree-l2"><a class="reference internal" href="notebooks/Replacing.html">Replacing Functions in the Dictionary</a></li> |
166 | +<li class="toctree-l2"><a class="reference internal" href="notebooks/Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
167 | +<li class="toctree-l2"><a class="reference internal" href="notebooks/Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
166 | 168 | <li class="toctree-l2"><a class="reference internal" href="notebooks/Recursion_Combinators.html">Recursion Combinators</a></li> |
167 | 169 | <li class="toctree-l2"><a class="reference internal" href="notebooks/Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
168 | 170 | <li class="toctree-l2"><a class="reference internal" href="notebooks/Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -871,6 +871,8 @@ | ||
871 | 871 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
872 | 872 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
873 | 873 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
874 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
875 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
874 | 876 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
875 | 877 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
876 | 878 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -522,6 +522,8 @@ | ||
522 | 522 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
523 | 523 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
524 | 524 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
525 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
526 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
525 | 527 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
526 | 528 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
527 | 529 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -259,6 +259,8 @@ | ||
259 | 259 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
260 | 260 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
261 | 261 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
262 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
263 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
262 | 264 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
263 | 265 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
264 | 266 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -1317,6 +1317,8 @@ | ||
1317 | 1317 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
1318 | 1318 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
1319 | 1319 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
1320 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
1321 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
1320 | 1322 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
1321 | 1323 | <li class="toctree-l2 current"><a class="current reference internal" href="#">Treating Trees I: Ordered Binary Trees</a></li> |
1322 | 1324 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -196,6 +196,8 @@ | ||
196 | 196 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
197 | 197 | <li class="toctree-l2 current"><a class="current reference internal" href="#">Quadratic formula</a></li> |
198 | 198 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
199 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
200 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
199 | 201 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
200 | 202 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
201 | 203 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -16,7 +16,7 @@ | ||
16 | 16 | <link rel="index" title="Index" href="../genindex.html" /> |
17 | 17 | <link rel="search" title="Search" href="../search.html" /> |
18 | 18 | <link rel="next" title="Treating Trees I: Ordered Binary Trees" href="Ordered_Binary_Trees.html" /> |
19 | - <link rel="prev" title="Replacing Functions in the Dictionary" href="Replacing.html" /> | |
19 | + <link rel="prev" title="Joy Example Code" href="Advent_of_Code_2017_December_1st.html" /> | |
20 | 20 | |
21 | 21 | <link rel="stylesheet" href="../_static/custom.css" type="text/css" /> |
22 | 22 |
@@ -622,6 +622,8 @@ | ||
622 | 622 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
623 | 623 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
624 | 624 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
625 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
626 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
625 | 627 | <li class="toctree-l2 current"><a class="current reference internal" href="#">Recursion Combinators</a></li> |
626 | 628 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
627 | 629 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -644,7 +646,7 @@ | ||
644 | 646 | <ul> |
645 | 647 | <li><a href="../index.html">Documentation overview</a><ul> |
646 | 648 | <li><a href="index.html">Essays about Programming in Joy</a><ul> |
647 | - <li>Previous: <a href="Replacing.html" title="previous chapter">Replacing Functions in the Dictionary</a></li> | |
649 | + <li>Previous: <a href="Advent_of_Code_2017_December_1st.html" title="previous chapter">Joy Example Code</a></li> | |
648 | 650 | <li>Next: <a href="Ordered_Binary_Trees.html" title="next chapter">Treating Trees I: Ordered Binary Trees</a></li> |
649 | 651 | </ul></li> |
650 | 652 | </ul></li> |
@@ -15,7 +15,7 @@ | ||
15 | 15 | <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> |
16 | 16 | <link rel="index" title="Index" href="../genindex.html" /> |
17 | 17 | <link rel="search" title="Search" href="../search.html" /> |
18 | - <link rel="next" title="Recursion Combinators" href="Recursion_Combinators.html" /> | |
18 | + <link rel="next" title="Joy Example Code" href="Advent_of_Code_2017_December_1st.html" /> | |
19 | 19 | <link rel="prev" title="Quadratic formula" href="Quadratic.html" /> |
20 | 20 | |
21 | 21 | <link rel="stylesheet" href="../_static/custom.css" type="text/css" /> |
@@ -195,6 +195,8 @@ | ||
195 | 195 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
196 | 196 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
197 | 197 | <li class="toctree-l2 current"><a class="current reference internal" href="#">Replacing Functions in the Dictionary</a></li> |
198 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
199 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
198 | 200 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
199 | 201 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
200 | 202 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -218,7 +220,7 @@ | ||
218 | 220 | <li><a href="../index.html">Documentation overview</a><ul> |
219 | 221 | <li><a href="index.html">Essays about Programming in Joy</a><ul> |
220 | 222 | <li>Previous: <a href="Quadratic.html" title="previous chapter">Quadratic formula</a></li> |
221 | - <li>Next: <a href="Recursion_Combinators.html" title="next chapter">Recursion Combinators</a></li> | |
223 | + <li>Next: <a href="Advent_of_Code_2017_December_1st.html" title="next chapter">Joy Example Code</a></li> | |
222 | 224 | </ul></li> |
223 | 225 | </ul></li> |
224 | 226 | </ul> |
@@ -348,6 +348,8 @@ | ||
348 | 348 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
349 | 349 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
350 | 350 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
351 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
352 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
351 | 353 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
352 | 354 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
353 | 355 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -518,6 +518,8 @@ | ||
518 | 518 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
519 | 519 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
520 | 520 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
521 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
522 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
521 | 523 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
522 | 524 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
523 | 525 | <li class="toctree-l2 current"><a class="current reference internal" href="#">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -184,6 +184,8 @@ | ||
184 | 184 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
185 | 185 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
186 | 186 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
187 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
188 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
187 | 189 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
188 | 190 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
189 | 191 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -2402,6 +2402,8 @@ | ||
2402 | 2402 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
2403 | 2403 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
2404 | 2404 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
2405 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
2406 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
2405 | 2407 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
2406 | 2408 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
2407 | 2409 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -334,6 +334,8 @@ | ||
334 | 334 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
335 | 335 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
336 | 336 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
337 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
338 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
337 | 339 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
338 | 340 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
339 | 341 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -56,6 +56,11 @@ | ||
56 | 56 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html#a-shorter-trace">A shorter trace</a></li> |
57 | 57 | </ul> |
58 | 58 | </li> |
59 | +<li class="toctree-l1"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a><ul> | |
60 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#next-part-of-the-challenge">Next Part of the Challenge</a></li> | |
61 | +</ul> | |
62 | +</li> | |
63 | +<li class="toctree-l1"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
59 | 64 | <li class="toctree-l1"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a><ul> |
60 | 65 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html#designing-recursive-functions">Designing Recursive Functions</a></li> |
61 | 66 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html#primitive-recursive-functions">Primitive Recursive Functions</a></li> |
@@ -197,6 +202,8 @@ | ||
197 | 202 | <li class="toctree-l2"><a class="reference internal" href="Developing.html">Developing a Program in Joy</a></li> |
198 | 203 | <li class="toctree-l2"><a class="reference internal" href="Quadratic.html">Quadratic formula</a></li> |
199 | 204 | <li class="toctree-l2"><a class="reference internal" href="Replacing.html">Replacing Functions in the Dictionary</a></li> |
205 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html">Joy Example Code</a></li> | |
206 | +<li class="toctree-l2"><a class="reference internal" href="Advent_of_Code_2017_December_1st.html#refactor-ftw">Refactor FTW</a></li> | |
200 | 207 | <li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a></li> |
201 | 208 | <li class="toctree-l2"><a class="reference internal" href="Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li> |
202 | 209 | <li class="toctree-l2"><a class="reference internal" href="Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li> |
@@ -1,1 +1,1 @@ | ||
1 | -Search.setIndex({docnames:["index","joy","lib","library","notebooks/Categorical","notebooks/Derivatives_of_Regular_Expressions","notebooks/Developing","notebooks/Generator_Programs","notebooks/Intro","notebooks/Newton-Raphson","notebooks/NoUpdates","notebooks/Ordered_Binary_Trees","notebooks/Quadratic","notebooks/Recursion_Combinators","notebooks/Replacing","notebooks/Square_Spiral","notebooks/The_Four_Operations","notebooks/Treestep","notebooks/TypeChecking","notebooks/Types","notebooks/Zipper","notebooks/index","parser","pretty","stack","types"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst","joy.rst","lib.rst","library.rst","notebooks/Categorical.rst","notebooks/Derivatives_of_Regular_Expressions.rst","notebooks/Developing.rst","notebooks/Generator_Programs.rst","notebooks/Intro.rst","notebooks/Newton-Raphson.rst","notebooks/NoUpdates.rst","notebooks/Ordered_Binary_Trees.rst","notebooks/Quadratic.rst","notebooks/Recursion_Combinators.rst","notebooks/Replacing.rst","notebooks/Square_Spiral.rst","notebooks/The_Four_Operations.rst","notebooks/Treestep.rst","notebooks/TypeChecking.rst","notebooks/Types.rst","notebooks/Zipper.rst","notebooks/index.rst","parser.rst","pretty.rst","stack.rst","types.rst"],objects:{"joy.joy":{joy:[1,1,1,""],repl:[1,1,1,""],run:[1,1,1,""]},"joy.library":{"void":[3,1,1,""],BinaryBuiltinWrapper:[3,1,1,""],DefinitionWrapper:[3,2,1,""],FunctionWrapper:[3,1,1,""],SimpleFunctionWrapper:[3,1,1,""],UnaryBuiltinWrapper:[3,1,1,""],add_aliases:[3,1,1,""],app1:[3,1,1,""],app2:[3,1,1,""],app3:[3,1,1,""],b:[3,1,1,""],branch:[3,1,1,""],choice:[3,1,1,""],clear:[3,1,1,""],cmp_:[3,1,1,""],concat_:[3,1,1,""],cond:[3,1,1,""],dip:[3,1,1,""],dipd:[3,1,1,""],dipdd:[3,1,1,""],disenstacken:[3,1,1,""],divmod_:[3,1,1,""],drop:[3,1,1,""],dupdip:[3,1,1,""],floor:[3,1,1,""],genrec:[3,1,1,""],getitem:[3,1,1,""],help_:[3,1,1,""],i:[3,1,1,""],id_:[3,1,1,""],infra:[3,1,1,""],initialize:[3,1,1,""],inscribe:[3,1,1,""],inscribe_:[3,1,1,""],loop:[3,1,1,""],map_:[3,1,1,""],max_:[3,1,1,""],min_:[3,1,1,""],parse:[3,1,1,""],pm:[3,1,1,""],pred:[3,1,1,""],primrec:[3,1,1,""],remove:[3,1,1,""],reverse:[3,1,1,""],select:[3,1,1,""],sharing:[3,1,1,""],shunt:[3,1,1,""],sort_:[3,1,1,""],sqrt:[3,1,1,""],step:[3,1,1,""],succ:[3,1,1,""],sum_:[3,1,1,""],take:[3,1,1,""],times:[3,1,1,""],unique:[3,1,1,""],warranty:[3,1,1,""],words:[3,1,1,""],x:[3,1,1,""],zip_:[3,1,1,""]},"joy.library.DefinitionWrapper":{add_def:[3,3,1,""],add_definitions:[3,3,1,""],parse_definition:[3,3,1,""]},"joy.parser":{ParseError:[22,4,1,""],Symbol:[22,2,1,""],text_to_expression:[22,1,1,""]},"joy.utils":{generated_library:[3,0,0,"-"],pretty_print:[23,0,0,"-"],stack:[24,0,0,"-"]},"joy.utils.generated_library":{ccons:[3,1,1,""],cons:[3,1,1,""],dup:[3,1,1,""],dupd:[3,1,1,""],dupdd:[3,1,1,""],first:[3,1,1,""],first_two:[3,1,1,""],fourth:[3,1,1,""],over:[3,1,1,""],pop:[3,1,1,""],popd:[3,1,1,""],popdd:[3,1,1,""],popop:[3,1,1,""],popopd:[3,1,1,""],popopdd:[3,1,1,""],rest:[3,1,1,""],rolldown:[3,1,1,""],rollup:[3,1,1,""],rrest:[3,1,1,""],second:[3,1,1,""],stack:[3,1,1,""],stuncons:[3,1,1,""],stununcons:[3,1,1,""],swaack:[3,1,1,""],swap:[3,1,1,""],swons:[3,1,1,""],third:[3,1,1,""],tuck:[3,1,1,""],uncons:[3,1,1,""],unit:[3,1,1,""],unswons:[3,1,1,""]},"joy.utils.pretty_print":{TracePrinter:[23,2,1,""],trace:[23,1,1,""]},"joy.utils.pretty_print.TracePrinter":{go:[23,3,1,""],viewer:[23,3,1,""]},"joy.utils.stack":{concat:[24,1,1,""],expression_to_string:[24,1,1,""],iter_stack:[24,1,1,""],list_to_stack:[24,1,1,""],pick:[24,1,1,""],stack_to_string:[24,1,1,""]},joy:{joy:[1,0,0,"-"],library:[3,0,0,"-"],parser:[22,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:exception"},terms:{"05s":5,"0b11100111011011":6,"23rd":19,"4ac":12,"5bkei":11,"9a9d60354c35":19,"\u03b4":5,"\u03b5":9,"abstract":[8,11],"boolean":[2,3,8,11,16],"break":[5,8,15,19],"byte":[5,6],"case":[2,3,13,16,17,19,24],"char":5,"class":[3,5,8,19,22,23,24],"const":15,"default":[3,7,11,24],"export":[3,22],"final":[2,11,13,15],"float":[8,19,20,22],"function":[0,1,4,6,7,10,12,15,18,20,21,22,23,24,25],"g\u00e9rard":20,"goto":5,"import":[2,5,6,7,9,11,12,13,14,15,17,18,19,20],"int":[5,7,8,13,15,19,20,22,24],"long":[11,15,19,21],"new":[0,2,3,5,7,8,10,13,14,15,19],"p\u00f6ial":21,"p\u00f6ial06typingtool":19,"public":10,"return":[1,3,5,6,8,11,13,14,16,17,19,22,23,24],"short":15,"static":[2,10],"super":19,"switch":[2,19],"throw":[11,25],"true":[2,3,5,6,13,15,16,19],"try":[7,9,12,13,15,17,18,19,21],"void":[0,3,15],"while":[3,5,8,11,19,22,24],AND:[5,19],Adding:[8,14,21],And:[5,6,7,9,11,13,15,16,19,20,24],But:[0,4,6,7,8,11,14,15,19],CPS:8,For:[0,2,3,11,13,14,19,21,24],Its:3,NOT:5,Not:19,One:[2,8,16,19,21],REs:5,TOS:[2,3],That:[6,11],The:[0,1,2,3,4,5,7,9,10,12,20,21,22,23,24,25],Then:[2,3,11,12,13,19],There:[5,12,13,15,16,17,19,24],These:[16,19,21,24],Use:[3,9,13],Used:16,Using:[0,9,11,21],With:[9,13,15,19,21,25],_1000:19,__add__:19,__call__:5,__class__:19,__eq__:19,__ge__:19,__hash__:19,__init__:[5,19],__main__:19,__radd__:19,__repr__:19,__str__:23,_and:5,_compaction_rul:5,_con:5,_dictionari:19,_ge:19,_infer:19,_interpret:19,_log:19,_log_it:19,_names_for:19,_or:5,_spn_e:15,_spn_p:15,_spn_t:15,_templat:5,_to_str:19,_tree_add_:11,_tree_add_e:[11,25],_tree_add_p:11,_tree_add_r:11,_tree_add_t:11,_tree_delete_:11,_tree_delete_clear_stuff:[11,25],_tree_delete_del:11,_tree_delete_r0:[11,25],_tree_delete_r1:11,_tree_delete_rightmost:11,_tree_delete_w:11,_tree_get_:[11,25],_tree_get_p:11,_tree_get_r:11,_tree_get_t:11,_tree_iter_order_curr:11,_tree_iter_order_left:11,_tree_iter_order_r:11,_tree_iter_order_right:11,_tree_t:11,_treestep_0:17,_treestep_1:17,_uniqu:19,_within_b:9,_within_p:9,_within_r:9,a10001:19,a10002:19,a10003:19,a10004:19,a_i:9,abbrevi:17,abl:[5,16,19,25],about:[0,8,11,16,19,20,24],abov:[0,5,6,9,11,13,16,19],abs:[0,9,15],absolut:8,accept:[0,1,2,3,5,6,7,8,11,12,14,15,16,17,19,20],accord:5,accordingli:[11,16],accumul:6,act:[5,25],action:[0,8,14,15,19,20,21],actual:[2,6,8,11,16,19],adapt:[15,21],add:[3,5,6,7,8,14,19,23,25],add_alias:3,add_def:3,add_definit:[3,11,17],added:[4,11],adding:[10,19],addit:[0,2,3,6,8,13,14,17],address:21,adjust:11,advantag:19,affect:[3,16],after:[5,6,7,8,13,16,19,25],afterward:8,again:[2,3,6,8,11,13,19],against:19,aggreg:20,ahead:19,aka:[5,8,20,25],albrecht:0,algorithm:[5,8,19],alia:3,alias:[3,8],align:[8,23],all:[3,5,6,7,8,11,13,14,15,16,17,19,23],alloc:19,allow:[10,11,16],almost:11,along:[5,8,13,19],alphabet:[3,21],alreadi:[5,9,14,19,20],also:[0,5,6,8,11,16,19,23,24],alter:[5,19],altern:[4,19],although:[4,11],altogeth:7,alwai:[6,10,13,16],amend:16,among:19,amort:11,analysi:[4,21],anamorph:[8,21],ani:[0,4,5,6,8,10,11,15,16,19,20,22],annual:8,anonym:11,anoth:[5,11,16,19,24,25],anyhow:[16,19],anyjoytyp:19,anymor:19,anystarjoytyp:19,anyth:[2,3,5,8,19,25],apart:19,api:10,app1:3,app2:[3,8,12,13,14,16],app3:[3,16],app:8,appear:[2,4,5,6,11],append:19,appendix:21,appli:[2,3,6,7,11,13,15,19],applic:7,approach:6,appropri:5,approxim:21,archiv:0,aren:20,arg:[2,3,15],argument:[2,3,8,9,12,13,15,21,23,24],arithmet:2,ariti:[2,16],around:[6,19,22,24],arrang:[15,17],arriv:[7,17],arrow:5,articl:[0,4,7,13],ascii:5,ascii_lowercas:5,ask:[4,7,19],aspect:0,assembl:[5,15],assert:[5,19],assign:[16,24],associ:11,assum:9,asterisk:17,asterix:[19,25],asyncron:16,attack:8,attempt:[0,1,19],attribut:3,attributeerror:19,author:19,auto:[0,19,25],automat:[4,16,19],auxiliari:[5,17],avail:[0,19,25],averag:[8,14],avoid:11,awai:[11,19],awar:2,awkward:[11,13,19],azur:21,back:[3,11,19],backtrack:25,backward:[10,11,12,17],bad:19,bag:8,banana:13,bar:16,barb:13,base:[0,2,3,10,13,17,19],basic:[2,3,8,11],basicconfig:[18,19],becaas:5,becaus:[2,3,5,8,11,16,17,19,20,24],becom:[0,11,15,17,24],becuas:19,been:[5,9,10,11,19,20],befor:[5,7,8,11],begin:[11,17],behavior:[10,17,25],behaviour:[0,1,19],behind:16,being:[0,16],below:[2,3,5,6,7,11,15,19,20],bespok:8,best:0,better:[6,11,13,19],between:[0,6],beyond:7,biannual:8,bin:5,binari:[0,7,8,21],binary_search_tre:11,binarybuiltinwrapp:3,bind:8,bingo:20,bit:[5,6,7,11,19],blank:22,bliss:[0,21],block:6,bodi:[2,3,5,8,11,16],body_text:3,booktitl:19,bool:[13,19,25],borrow:[8,19],both:[2,6,8,12,13,14,15,16,19,24],bottom:7,bounce_to:5,bracket:[8,19,22],branch:[3,5,6,7,13,19,21,25],branch_fals:19,branch_tru:19,breakpoint:8,bring:[6,8,19],bruijn:19,brutal:16,brzozowski:[19,21],brzozowskian:5,btree:[11,17],buck:11,bug:[0,8],build:[7,8,12,13,15,20,24],built:[12,19],bundl:[2,3,13],burgeon:8,calculu:4,call:[1,2,5,8,10,11,13,16,19,23,24],caller:[11,19],can:[0,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,19,20,21,22,24,25],cancel:16,cannot:[18,19,22],captur:8,card:8,care:[6,24],carefulli:20,carri:[7,11],cartesian:4,catamorph:21,categor:[0,21],categori:[4,16],ccc:4,ccon:[3,11,18,19,25],cell:[13,19],certain:[8,24],certainli:11,chain:[3,16],chang:[2,10,11,15,19,20],charact:[5,20],chat:8,chatter:[0,19],check:[0,7,9,19,21],child:17,choic:[3,13],choos:10,chop:12,chose:5,cinf:11,circl:5,circuit:[4,15],cite_not:11,classmethod:3,claus:[3,19],clean:19,clear:[3,6,8],clear_stuff:11,cleav:[8,12,14],close:[0,1,4],clunki:[6,19],clv:16,cmp:[3,17,21],cmp_:3,code:[1,4,5,12,13,16,19,21,25],codireco:[7,9,15],collaps:13,collect:[4,5,7,8,19],combin:[0,3,6,7,8,9,12,15,16,17,20,21,23,25],combinatorjoytyp:19,come:[8,11,19],command:[8,11,19],comment:16,common:[2,6,16],compar:[3,4,5,15,19],comparison:[0,11],compat:16,compel:4,compil:[2,4,5,8,11,14,16,21,25],complement:5,complet:4,complex:[3,16,19,20,25],complic:19,compos:[5,25],composit:19,compostit:19,compound:11,comput:[2,4,5,6,8,12,15,16,19,25],con:[3,5,6,7,8,9,11,12,13,15,16,17,20,24,25],conal:[4,16],concat:[3,7,8,16,17,19,24],concat_:3,concaten:[0,5],concatin:[0,3,5,24],concern:16,conclus:21,concurr:2,cond:[3,11],condit:[3,8],condition:15,confer:19,conflict:[11,19],consecut:21,consid:[5,6,7,11,13,17,19,20],consist:[2,7,8,16,17],constant:11,constitu:13,constraint:15,construct:[0,15,16,19],consum:[15,16,19],contain:[0,2,3,5,7,8,13,15,19,22],content:19,context:2,conting:11,continu:[0,5,13,19,20],control:8,conveni:[4,16,19],convent:16,convers:19,convert:[13,14,17,19,22,24],cool:11,coordin:[0,15],copi:[2,3,6,11,13,15,16,17,18,21],copyright:8,correspond:[4,16],could:[2,4,5,6,8,10,11,16,19,20],couldn:16,count:[3,19],counter:[6,19],coupl:17,cours:[6,11,19],cout:15,cover:19,cpu:16,crack:11,crash:11,creat:[0,2,3,6,9,11,16,19],creativ:19,crude:[11,19,22],cruft:19,curent:25,current:[2,3,8,13,15,16,17,19,20,23,25],curri:5,custom:10,cycl:[6,7],cython:8,d010101:5,d0101:5,d01:5,d10:5,d_compact:5,dai:8,data:[2,3,5,13],datastructur:[0,2,13,19,21,22,24],datatyp:24,ddididi:20,deal:[0,5,11,16],dealt:19,debugg:19,decid:11,declar:19,decor:3,decoupl:13,decrement:[0,3],deduc:[6,19],deeper:0,deepli:4,def:[3,5,8,13,14,19,24],defaultdict:[5,19],defi:3,defin:[2,3,4,5,6,7,8,9,10,12,13,14,15,16,19,20,21],definit:[0,2,3,6,7,8,10,11,13,15,17,19,21,25],definitionwrapp:[3,11,13,17],defint:16,del:18,deleg:8,delet:21,deliber:19,demo:19,demonstr:4,depend:[3,11,13,16],deposit:17,depth:[19,25],dequot:13,der:11,deriv:[2,3,6,8,9,11,19,21],derv:5,describ:[3,4,5,11,13,16,17,19,22],descript:[6,8],descriptor:19,design:[2,3,11,16,21],desir:[8,17],destin:5,destruct:11,detail:[8,11,19],detect:[5,7,11,13,19],determin:21,develop:[0,7,8,19,21],diagram:6,dialect:1,dict:[1,3,5,19,23],dictionari:[0,1,3,8,19,21,23],did:19,differ:[0,4,6,9,11,12,13,16,24],differenti:4,difficult:19,difficulti:16,dig:[11,20],digit:6,digraph:5,dinfrirst:[8,15,19,25],dip:[0,3,6,7,8,9,11,12,13,14,15,16,17,19,21,25],dipd:[3,7,8,11,12,13,15,16,19,20,25],dipdd:[3,11],direco:21,direct:8,directli:[6,16,17,19,24],disappear:[2,5,19],discard:[3,7,9,11,13],disciplin:11,disctionari:1,disenstacken:[3,8],disk:8,displac:2,displai:19,distiguish:19,distribut:16,ditch:11,div:[3,8,19,25],dive:17,divis:[11,19],divmod:[3,25],divmod_:[3,19],doc:[2,3,8,19],doc_from_stack_effect:18,docstr:19,document:[19,21,22,24],doe:[0,1,3,4,5,7,8,14,16,19,21,23,25],doesn:[6,10,11,15,16,17,19,24],doing:[4,6,8,16,19,20],domain:[4,19],don:[5,6,8,11,19],done:[2,6,8,10,19],dooooc:19,door:8,dot:[5,23],doubl:[3,5,6,8,19],doublecircl:5,down:[2,5,9,13,20,25],down_to_zero:8,dozen:8,draft:[4,10],dream:8,drive:[7,9],driven:6,driver:[5,7],drop:[3,11],dudipd:8,due:19,dup:[3,6,7,8,9,11,12,13,15,16,18,20,24,25],dupd:[3,19,25],dupdd:[3,25],dupdip:[3,6,11,12,13,15],duplic:[3,11,13],durat:2,dure:[2,13],each:[2,3,4,5,6,8,13,14,15,16,17,19,23,25],easi:[0,11,15,17,19,20],easier:[3,11,16],easili:4,eat:5,edit:21,effect:[2,3,5,8,16,20,21,25],effici:[7,14,20],efg:19,either:[1,2,3,5,11,13,19],elabor:19,eleg:[0,5,8,11,16,21],element:[2,3],elif:19,elimin:[5,19],elliott:[4,16],els:[2,3,5,13,15,16,19],else_:19,embed:[4,11,20],emit:19,empti:[3,5,8,17,19,24,25],encapsul:8,enclos:8,encod:7,encount:19,end:[5,6,11,13,17,19,24],endless:7,enforc:[2,8],engend:8,enough:[5,8,13,23,25],enstacken:[7,8,19],enter:[3,8],enter_guard:19,entir:24,entri:[3,20,23],enumer:19,epsilon:9,equal:[3,6,17,24],equat:[8,9],equival:16,ergo:[5,11],err:[11,18],error:[8,19,22],essai:0,establish:19,etc:[3,17,19,20,22],euler:21,euro:19,eval:[0,19],evalu:[1,2,3,8,9,11,12,13,14,16,17,19,23],event:16,eventu:[16,19],ever:19,everi:[1,7,16],everybodi:16,everyth:[3,5,11,12,16,19],evolv:10,examin:13,exampl:[3,5,6,19,21,22,24,25],exce:7,except:[5,8,11,18,19,22],execut:[0,1,2,3,8,13,14,16,17,19,20,24,25],exend:19,exercis:[5,11],exist:[4,11,19],expand:11,expect:[2,3,16,17,19,24],experi:[8,17],explain:19,explan:8,explor:[8,19],express:[0,1,2,3,4,11,13,14,15,19,20,21,23,24],expression_to_str:[19,24],extend:19,extra:[6,7],extract:[11,12,21],extrem:8,extrememli:8,f_g:19,f_in:19,f_out:19,f_python:19,facet:0,facil:8,fact:22,factor:[2,6,8,11,15,19],factori:[3,21],fail:[2,3,11,21,22],fail_fail:3,fairli:19,fake:5,fall:19,fals:[2,3,5,6,13,15,16,19],falsei:19,familiar:[0,15],far:[9,11,13,19,25],fascin:0,favorit:16,fear:[11,19],few:[6,8,9,12,16,19],fewer:[3,8],fg_in:19,fg_out:19,fib:7,fib_gen:7,fibonacci:21,figur:[2,3,11,13,19],file:15,filter:11,fin:6,find:[2,3,5,6,7,16,17,19,21,25],finder:9,fine:[0,5,6,11,19,25],finite_state_machin:5,first:[3,5,7,8,9,11,12,13,14,17,20,21,25],first_two:[3,11,25],fit:[6,8],five:[6,8,21],fix:[2,3,5,13,19],fixm:[5,19],flag:[16,19],flatten:[8,17,19],flesh:5,flexibl:21,floatjoytyp:19,floatstarjoytyp:19,floor:3,floordiv:[6,25],flow:8,follow:[0,2,3,5,8,10,13,16,17,19,20],foo:[8,10,11,16,19],foo_ii:10,fork:16,form:[2,3,4,5,6,7,13,17,19,21,24],forman:8,format:[18,19,21,23],formula:[0,6,21],forth:[8,19],forum:0,forward:19,found:8,four:[0,2,3,6,7,8,11,15,21],fourteen:6,fourth:[2,3,11,13,25],frac:[9,12],fractal:8,fraction0:8,fraction:[2,8],frame:13,framework:8,free:[4,8,11],freeli:2,from:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,24],from_:5,front:[2,3,13],frozenset:5,fulin:16,full:6,fun:[5,21],func:19,functionjoytyp:19,functionwrapp:3,functool:5,fundament:[0,21],funtion:11,further:[9,19,21],futur:16,g_in:19,g_out:19,garbag:8,gari:11,gcd:8,gener:[0,2,4,13,16,19,21,24,25],generated_librari:3,genrec:[3,8,11,13,16,17,19],geometr:6,get:[2,4,5,6,7,8,12,13,19,21],getch:5,getitem:3,getrecursionlimit:24,getsourc:8,ghc:4,give:[4,6,11,13,15,17,19,24],given:[2,3,6,7,9,11,13,15,16,19,20,21],global:[18,19],glue:8,goe:25,going:[5,11,12,15,16,17,19,20],good:[6,11,19],grab:19,grammar:22,grand:8,graph:16,graphic:5,graphviz:5,great:[0,8,19,21],greater:24,grind:19,group:0,grow:5,gsra:9,guard:[11,19],had:[5,6,20],haiku:8,half:[6,19,20],hallmark:16,hand:[5,8,14,19,21],handi:[9,19],handl:[11,19,24,25],happen:[8,19],happi:5,hard:[5,19,20],hardwar:4,has:[0,2,3,5,7,8,9,10,11,13,16,19,20,24],hasattr:19,hash:19,haskel:4,have:[2,3,5,6,7,8,9,10,13,14,15,16,19,20,21,24,25],head:24,heh:19,help:[0,8,11,13,15,19],help_:3,helper:[3,5],herd:8,here:[0,5,6,7,11,15,17,19,20,25],hide:11,hierarchi:19,higher:[5,8,11,19],highli:8,hij:5,histori:[19,23],hit:5,hmm:[5,11],hoist:3,hold:[6,19],hood:11,hope:[0,6,8,21],hopefulli:13,host:21,how:[0,4,5,9,11,13,15,19,20,21],howev:[13,14,16,19],html:[2,3,7,12,13,21],http:[11,25],huet:20,huge:11,hugh:[9,17],human:8,hybrid:[15,25],hylomorph:21,hypothet:2,id_:3,idea:[4,6,8,19],ident:[3,5,13,19,25],if_not_empti:11,ift:[0,3,11,13,15,17,19,25],ignor:[1,3,11,19],iii:21,illustr:[5,13],imagin:[5,16,20],imap:19,imit:[5,17],immedi:[5,13],immut:[5,8,11],imper:13,implement:[0,1,2,3,4,8,10,11,13,14,16,21,25],implementaion:16,implicit:8,improv:19,includ:[4,11,16,17,19,25],inclus:6,incom:24,incompat:10,incorpor:12,increas:6,increment:[0,3,4,6,10,16],index:[0,8,19,24],indexerror:24,indic:[16,17,19,25],ineffici:19,infer:[0,18],inferenc:25,info:[18,19],inform:[3,5,19,25],infra:[3,7,8,11,12,14,15,16,17,19,21,25],infrastructur:3,initi:[2,3,5,8,9,11,19],inlin:11,inner:19,inproceed:19,input:[1,9,16,18,19],input_:5,inscrib:3,inscribe_:3,insert:19,insight:13,inspect:8,inspect_stack:19,instal:0,instanc:19,instanti:[4,23],instead:[5,6,7,11,13,15,19,20,24,25],instruct:5,integ:[0,2,3,8,13,15,17,19,22],integr:3,intend:[0,8],interact:[8,21],interest:[0,6,11,19,21],interfer:16,interlud:21,intermedi:13,intern:[0,19,23,24],interpret:[0,4,10,14,22,23,25],interrupt:8,intersect:5,interspers:16,interv:[4,6],intjoytyp:19,introduc:10,introduct:0,intstarjoytyp:19,intuit:19,invari:3,invent:19,involv:19,ipf:8,ipython:19,isinst:[5,19],isn:[5,11,20],issubclass:19,item:[2,3,8,11,13,16,17,19,21,24],iter:[1,3,5,8,13,16,17,19,21,24],iter_stack:[14,24],iteritem:[5,19],itertool:[5,19],its:[0,1,2,3,4,6,8,11,13,15,16,17,19,24],itself:[0,2,8,11,16,19],j05cmp:[2,3,13],jaanu:19,jmp:5,job:[16,21],john:[9,17],joi:[2,4,10,11,12,14,16,18],join:[5,19],joypi:[20,25],joytypeerror:18,jump:5,jump_from:5,junk:19,jupyt:21,just:[0,2,3,5,7,8,10,11,13,15,16,17,19,20,23],juxtaposit:16,keep:[5,11,12,16,19,20],kei:[5,17,21],kevin:0,key_n:11,keyerror:[5,11,19],kind:[0,2,4,8,11,13,15,17,19,25],kinda:19,kleen:[17,19],kleenestar:19,kleffner:19,know:[6,11,19],knowledg:19,known:[4,16],kstar:5,l_kei:11,l_left:11,l_right:11,l_valu:11,label:[5,19],lambda:[4,5,19],languag:[3,4,5,8,10,11,14,19],larg:[5,19],larger:[21,24],largest:3,last:[6,11,13,19],lastli:7,later:[5,8,15,17,19],law:2,layout:[0,15],lazi:19,lazili:9,lcm:6,lead:[5,8,19],leaf:11,lean:8,learn:0,least:[2,6,13,19,24],least_fract:8,leav:[3,6,15,16],left:[5,8,12,13,16,17,19,20,23,24],leftov:13,legend:5,legibl:[0,15],len:[5,19],length:[3,6,24],lens:13,less:[6,7,8,13,19,24],let:[7,9,11,12,13,15,17,19,20,21],letter:19,level:[4,5,11,18,19],librari:[0,5,14],like:[0,2,3,5,6,8,15,16,17,19,21,22,23,25],limit:[19,25],line:[3,8,11,12,19,23,25],linear:24,link:[0,5,19],linux:0,list:[0,3,5,6,8,9,11,13,16,17,19,20,23],list_to_stack:[19,24],liter:[1,11,17,19,20,22],literatur:19,littl:[0,5,7,11,15,16,19,21],live:21,lkei:17,load:[6,8],local:19,locat:2,locu:23,log:[18,19],log_2:11,logic:[0,6,15,21],longer:[11,19],look:[1,5,7,8,9,11,12,15,16,19],lookup:8,loop:[0,1,3,5,6,19,21,25],lose:19,lot:[5,8,11,19,20],love:6,low:[4,5],lower:6,lowercas:[5,19],lowest:11,lshift:25,machin:[0,21],machineri:[11,19],macro:8,made:[0,8,16,19,20],magic:19,mai:[2,13,16,25],mail:0,main:[0,3,8,12,15,16,19,20],mainloop:10,maintain:20,major:10,make:[2,3,4,6,8,11,13,14,15,16,17,19,20,21],make_gener:[9,15],make_graph:5,manfr:[0,2,3,4,13],mani:[0,5,8,19],manipul:19,manner:12,map:[1,3,5,6,8,10,13,17,19,23],map_:3,marker:8,mask:[6,7,15],match:[0,1,19,21],materi:0,math:[0,8,9,11,12,19],mathemat:8,matter:[6,9,11,17],max_:3,maximum:3,mayb:[11,19],mean:[4,6,8,9,11,13,17,19,24],meant:[8,11,13,17],mem:5,member:[2,3,13],memo:5,mental:8,mention:2,mercuri:0,mess:19,messag:[18,19],meta:[8,11,14],meta_compos:19,method:[0,3,8,19,21,23],midpoint:6,might:[0,4,5,7,11,15,19],mike:11,million:7,min_:3,mind:19,minimum:3,minor:11,minu:3,mirror:0,miscellan:0,mismatch:19,mix:[8,19],mod:3,mode:19,model:[4,8],modern:0,modif:[7,19],modifi:[8,11,20],modul:[0,1,3,8,19,22],modulo:19,modulu:[8,25],moment:19,month:8,more:[0,3,4,5,6,7,8,9,13,14,16,17,19,22,24,25],most:[5,19,25],mostli:0,move:[5,11],movement:2,much:[5,6,7,11,13,19],muck:11,mul:[3,8,12,18,20,23,25],multi:3,multipl:[21,25],multipli:3,must:[2,3,6,10,13,16,17,19,22],myself:19,n10001:19,n10002:19,n10003:19,n1001:19,n1002:19,n1003:19,name:[1,3,5,8,10,11,13,19,20,21,22,23,24,25],narr:19,natur:[5,6,7,11,19],navig:20,nearli:19,neat:11,neato:19,necessarili:19,need:[2,3,6,7,9,10,11,13,15,16,19],neg:[3,12,25],neither:[16,19],ness:5,nest:[3,8,11,20],net:25,network:8,never:[5,10,13],new_def:19,new_f:19,new_fo:19,new_kei:11,new_valu:11,newton:[0,21],next:[0,5,6,15,16,17,19,25],nice:[0,5,13,24],niether:2,node:[5,17,21],node_kei:11,node_valu:11,non:[5,17,19],none:[1,3,19],nope:17,nor:5,normal:16,notat:[0,8,11,15],note:[2,5,6,9,11,13,16,19,24],notebook:[6,7,8,19,20,21],notebook_preambl:[2,6,7,9,11,12,13,14,15,17,19,20],noth:[2,11,16],notic:6,now:[3,5,6,7,8,13,14,17,19,21],nth:[3,24],nullari:[8,11,15,16,19,25],number:[0,1,2,3,6,7,9,15,16,24,25],numberjoytyp:19,numberstarjoytyp:19,numer:19,object:[5,19,22],observ:6,obviou:7,obvious:19,occur:11,odd:[6,7],off:[2,3,6,7,12,15,19,20],often:[5,16],old:[2,14],old_k:11,old_kei:11,old_valu:11,omg:5,omit:[13,19,22],onc:[3,5,10,11],one:[0,2,3,5,6,7,11,13,15,16,17,19,23,24,25],ones:[5,7,19],onli:[2,3,5,6,11,13,15,16,19,20,24],onto:[1,2,3,8,13,24],open:[8,19],oper:[0,3,5,8,11,13,21,24],oppos:19,optim:11,option:[1,8,11,19,24],orchestr:16,order:[0,2,3,8,13,16,18,19,21,24],org:[0,11],origin:[0,1,2,3,11,20,21],osdn:25,other:[0,2,3,4,5,8,11,13,15,17,19,24],otherwis:[3,5,6,7,11,17,19],our:[5,6,7,8,9,13,15,17,19],out:[2,3,4,6,7,8,9,11,12,13,15,16,19,20,21],outcom:17,outlin:5,output:[5,9,13,16,18,19,25],outsid:4,over:[3,4,6,7,8,9,11,12,16,17,19,21,25],overhaul:19,overview:[3,19],own:[11,19],pack:24,packag:[0,8],page:[0,11,19,24],pair:[0,2,3,6,7,11,15,19],palidrom:6,palindrom:6,pam:8,paper:[4,8,13,16,20],paradigm:21,parallel:[2,21],paramet:[1,2,3,13,14,22,23,24],parameter:21,paramorph:13,parenthes:[11,24],pariti:7,pars:[0,3,5,8],parse_definit:3,parseerror:22,parser:[0,18,19],part:[2,3,9,13,17,21],partial:[5,19],particular:20,pass:[0,5,11,19,23],patch:5,path:[5,15,19,21],pattern:[5,6,16,17,21],pe1:[6,7],pe2:7,pearl:20,pend:[3,8,13,19,20,23],peopl:21,per:[8,17],perfectli:16,perform:[5,16,19],perhap:7,period:8,permit:[16,19,24],permut:19,persist:[3,11],phase:2,phi:5,phrase:15,pick:[6,7,16,24],pickl:8,pictur:11,piec:[13,21],pip:0,place:[3,6,8,19],plai:0,plu:3,plug:[7,13,17],point:[4,5,8,11,13,15,16],pointless:2,pool:16,pop:[0,3,5,6,7,8,11,13,14,15,17,18,24,25],popd:[3,8,9,11,14,16,19,25],popdd:[3,7,12,19,25],popop:[3,6,7,8,9,11,17,19,25],popopd:[3,25],popopdd:[3,25],posit:[3,6,8,13],possibilit:11,possibl:[11,17,19,21],post:8,poswrd:19,potenti:16,pow:25,power:[8,19],pprint:5,pragmat:6,preambl:9,preceed:16,precis:[0,1],pred:[3,19,25],predecessor:3,predic:[2,3,5,7,13,16],prefix:[19,23],preliminari:5,present:19,preserv:[4,17],pretti:[9,11,12,16,17,19,23,24],pretty_print:0,previou:[8,16],prime:9,primit:[2,3,19,21],primrec:[3,7,8,9,13],print:[0,1,2,3,5,18,19,23,24],probabl:[7,8,11,19],problem:[8,15,19,21],proc_curr:11,proc_left:11,proc_right:11,proce:[6,25],process:[5,8,17,19,23],produc:[3,6,11,13,17,19],product:[5,7,8,18,19],program:[0,2,3,7,8,9,11,13,15,16,19,20],programm:[16,19],progress:16,project:[21,25],prolog:19,promis:16,prompt:8,proper:[2,3,13,16,25],properti:0,provid:[0,3,4,8,16,19,25],pseudo:15,pun:[0,8],punctuat:19,pure:[0,5],puriti:8,purpos:8,push:[2,3,8,13,20,24],put:[1,2,7,8,16,19,21,24],pypi:0,python3:8,python:[0,2,3,5,11,13,16,20,21,22,24,25],quadrat:[0,21],quasi:15,queri:[11,17],query_kei:17,queu:13,quit:[0,17],quot:[0,3,7,8,11,12,13,15,16,17,19,20,23],quotat:[2,3,13],quotient:3,r_kei:11,r_left:11,r_right:11,r_valu:11,rais:[5,11,19,22,24],rang:[5,8,19],range_revers:13,range_to_zero:8,ranger:13,ranger_revers:13,rankdir:5,raphson:9,rather:[6,8,13,15,17],ratio:8,reach:[5,6,7,13],read:[0,1,6,7,11,19,20],readabl:14,reader:[5,11],readi:19,readm:15,real:11,realiz:[4,11,15],rearrang:[2,11,19],reason:[6,8,16,19],rebuild:[17,20],rec1:[2,3,13],rec2:[2,3,13],recent:19,recogn:22,recombin:16,record:[8,23],recur:[3,13,19],recurs:[0,2,3,5,7,8,9,16,19,21,24],recus:8,redefin:21,redistribut:[3,8],redo:5,reduc:[2,19],redund:24,refactor:[8,10],refer:[0,2],referenti:16,reflect:16,regard:16,region:15,regist:2,regular:[19,21,22],reifi:18,reimplement:[16,21],relat:[5,19],releas:10,remain:[2,8,10,19],remaind:[3,9],rememb:5,remind:19,remov:[3,11,19,24,25],render:21,repeat:6,repeatedli:6,repetit:5,repl:[0,1],replac:[0,2,3,7,12,13,16,17,19,20,21,24],repositori:0,repr:[5,19],repres:[2,8,11,16,22,23],represent:24,reprod:7,repurpos:19,requir:[15,16,19,24],res:19,research:19,resembl:8,resolut:16,resourc:[3,16],respect:[5,6,16],rest:[3,6,7,8,11,13,15,20,21,24,25],rest_two:11,restart:3,restor:2,result:[1,2,3,5,6,11,12,13,16,17,19,20],resum:8,retir:2,retri:8,reus:[11,19],revers:[3,6,7,13,19,20,21,24],revisit:19,rewrit:[3,8,15,19],rewritten:8,rid:11,right:[7,8,12,17,19,21,23,24],rightest:11,rightmost:6,rigor:16,risk:19,rkei:17,rob:19,roll:[3,9,11,17],roll_dn:19,rolldown:[3,18,19,25],rollup:[3,19,25],root:[3,9,12],rough:15,round:19,row:5,rrest:[3,18,19,25],rshift:25,rule:[16,21],run:[0,1,3,6,8,9,11,12,13,15,16,17,19,20],runtim:16,runtimeerror:24,sai:[5,7,11,12,15,17,19],same:[2,4,6,11,16,19,24],sandwich:[2,3,13],save:[2,5,6,8],scan:3,scanner:[8,22],scenario:20,scm:25,scope:[7,11],search:[0,11],sec:19,second:[3,8,11,13,15,17,24,25],section:13,see:[0,5,7,8,9,10,12,13,14,15,19,20,23],seem:[0,6,8,15,17,19,25],seen:[19,20],select:3,self:[5,16,19],semant:[2,3,8,10,11,16,19],semi:8,send:8,sens:[0,2,6,19,20],separ:[8,16,19,22],seq:19,sequenc:[0,1,2,3,6,8,11,13,14,20,21,22,25],sequence_to_stack:19,seri:[6,7,11,15,20],ses:19,set:[2,3,5,13,19,21],seven:[6,7],sever:[0,4,8,13],shape:[5,16],share:[3,8],shelf:2,shew:5,shift:[6,7],shorter:21,shorthand:11,should:[2,3,5,6,11,13,16,19],shouldn:8,show:[4,15,16,19,20],shunt:[3,20],side:[5,11,18,19,25],sign:3,signatur:25,signifi:[8,11],similar:[11,15,17,19],simon:8,simpl:[5,8,13,15,24,25],simplefunctionwrapp:[3,14,19],simpler:17,simplest:[19,21],simpli:4,simplifi:[6,11,20],sinc:[2,6,11,15,19],singl:[3,7,8,14,15,16,19,22,25],singleton:5,situ:11,situat:11,six:[6,7,8],sixti:[6,7],size:[5,8,21],skeptic:8,skip:19,slight:9,slightli:[11,13,19],smallest:3,smart:11,softwar:8,solei:2,solut:[6,7],solvabl:8,some:[0,2,3,5,7,8,11,13,15,16,17,19,21,24,25],somehow:[11,19],someth:[2,10,11,19],sometim:11,somewher:[11,21],sort:[3,5,11,16,19],sort_:3,sourc:[0,1,3,19,21,22,23,24],space:[6,23],span:6,spawn:19,special:[7,11,21],specif:[0,4],specifi:[11,16],speed:14,spell:[5,17],sphinx:[21,24],spiral:[0,21],spiral_next:15,spirit:[0,1,17],split:[5,19],sqr:[3,8,9,12,20],sqrt:[3,9,19,25],squar:[0,3,9,19,21,22],stack:[0,1,3,6,7,9,11,12,13,14,15,16,17,18,20,21,22,23,25],stack_effect:19,stack_effect_com:19,stack_to_str:[18,24],stacki:19,stackjoytyp:19,stackoverflow:15,stackstarjoytyp:19,stage:17,stai:[0,1],stand:[4,5],standard:[8,11],star:[17,19],stare:11,start:[5,6,7,8,9,11,13,17,19,25],state:[8,21],state_nam:5,statement:[3,5,15],stdout:[18,19],step:[3,6,8,11,14,19,20,21],stepper:15,still:[5,11,19],stop:11,stopiter:5,storag:[6,11],store:[6,13,19],stori:13,str:[1,5,19,22,23,24],straightforward:[5,7,9,15,19,21],stream:[6,18,19],stretch:11,string:[1,2,3,8,19,20,21,22,23,24],stringi:5,structur:[8,16,17,19,20,21,24],stuck:5,studi:5,stuff:[11,19],stuncon:[3,25],stununcon:[3,25],style:[0,4,19],sub:[10,16,25],subclass:8,subject:[16,20],subsequ:16,subset:[19,25],substitut:[5,11,19],subtract:6,subtyp:21,succ:[3,19,25],succe:19,success:9,suck:19,suffic:19,suffici:11,suffix:19,suggest:[4,5,11],suitabl:[3,4,6],sum:[3,7,8,12,13,14,17],sum_:[3,19],summand:6,sumtre:17,suppli:[11,22],support:[8,19,23,24],sure:16,suspect:2,svg:5,swaack:[3,12,14,15,19,20,25],swap:[3,6,7,8,9,11,13,14,15,16,17,18,20,25],swon:[3,7,8,13,17,19,20,25],swoncat:[7,8,9,13,17],swuncon:13,sym:5,symbol:[1,2,3,5,16,19,20,21,22],symboljoytyp:19,symmetr:[6,11,15],symmetri:[5,15],syntact:8,syntax:[8,24],sys:[18,19,24],system:[8,11,16],tabl:[5,19],tag:[5,19,25],tail:[11,19,21,24],tailrec:3,take:[3,5,6,8,9,11,13,15,16,19,24],talk:[8,11,19,24],target:20,tast:4,tbd:8,tear:13,technic:2,techniqu:[4,20],technolog:2,temporari:20,ten:6,term:[1,2,5,8,9,13,16,19,21,22,24,25],termin:[2,3,5,13],ternari:8,test:[2,3,13],text:[0,1,3,19],text_to_express:[8,18,22],textual:8,than:[0,3,5,6,7,8,9,13,16,17,19,24,25],thei:[2,5,6,7,8,11,13,15,16,19,20,22,24],them:[0,2,3,5,6,7,11,13,15,16,19,20,21,25],themselv:[16,19],theori:[2,3,13,16],therefor:7,thi:[0,1,2,3,4,5,6,7,8,9,12,13,15,16,17,19,20,21,22,23,24,25],thing:[2,7,11,13,16,19,20,22,24,25],think:[2,6,8,11,13,16,17,19],third:[3,7,8,11,25],thirti:6,those:[2,3,5,11,13,15,19,21,25],though:[6,16],thought:[8,16],thousand:6,thread:[2,16],three:[2,3,5,6,8,11,12,15,17,19,21],through:[1,6,8,17,19,20,24,25],thun:[2,3,4,10,13,16],thunder:8,thunk:16,time:[3,5,6,8,9,11,13,15,16,19,20],titl:19,to_check:5,to_set:11,todai:8,todo:[8,22],togeth:[7,8,16,19,21],token:22,toler:21,too:[5,13,19],tool:[8,19],tooo:19,top:[2,3,8,13,19,23,24],total:6,tower:19,trace:[0,8,12,13,15,20,21,24],traceback:19,traceprint:23,track:[12,19,20],tracker:0,transform:4,transit:5,translat:[4,12,19,21],trap:5,travers:[0,21],treasur:0,treat:[0,2,3,13,19,21],treatment:7,tree:[0,8,21],treegrind:21,treestep:[0,21],tri:6,triangl:16,triangular_numb:13,trick:[6,19],tricki:19,trobe:0,trove:0,truediv:25,truthi:[3,8,16,19],tuck:[3,8,19,25],tupl:[3,5,8,19,24],turn:[2,3,5,19,21],twice:[11,13],two:[0,2,3,6,8,9,11,12,13,15,16,17,18,19,20,21,24,25],txt:3,type:[0,1,4,8,11,13,16,21,22,23,24],typeerror:19,typeless:19,typic:[2,3,12,13],ulam:[0,15],unari:8,unarybuiltinwrapp:3,unbalanc:[11,22],unbound:25,unchang:11,uncompil:19,uncon:[3,7,8,11,13,17,20,25],under:[2,3,8,11],underli:[5,16,19],underscor:19,understand:[0,11],undistinguish:11,undocu:8,unfinish:5,unfortun:24,unicod:19,unif:[19,21],unifi:18,union:5,uniqu:[3,5,11,19],unit:[3,8,13,16,25],univers:[0,8,16,19],unlik:16,unnecessari:21,unnecesssari:19,unpack:[2,3,11,24],unpair:6,unquot:[8,15,17,22],unread:[0,15],unrol:5,unstack:19,unswon:[3,25],untangl:13,until:[5,7,16],unus:6,unusu:11,unwrap:5,updat:[0,18,21,25],uppercas:5,upward:16,usag:8,use:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,20,21,24],used:[0,3,4,8,11,13,15,16,19,20,22,24],useful:[0,16,19],user:17,uses:[2,3,5,6,13],using:[7,11,12,13,15,17,20,25],usual:[0,2,13],util:[0,3,14,18,19],valid:19,valu:[0,1,2,3,6,8,9,12,13,14,15,16,17,19,21,22,24,25],value_n:11,valueerror:[5,19,24],variabl:[19,21],variant:11,variat:[13,16,21],varieti:[4,8],variou:0,vener:24,verbos:4,veri:[0,1,4,5,8,11,15,24],versa:[2,19],version:[0,1,2,5,7,10,17,20,21],via:8,vice:[2,19],view:[11,21],viewer:[1,8,10,23],vii:21,visibl:19,von:[0,2,3,4,13],waaaai:5,wai:[0,2,3,4,5,6,8,13,14,15,16,19],wait:16,want:[2,3,6,7,9,11,13,19],warranti:[3,8],wash:8,wast:8,web:24,websit:[0,6],welcom:8,well:[0,4,8,9,11,19,22],went:19,were:[8,19,20],what:[2,3,4,5,8,11,13,16,17,19,23],whatev:[2,3,13,17,24],when:[6,7,8,11,13,16,19,20,22,24,25],where:[2,3,5,8,11,13,15,19,21,24],whether:[3,13],which:[0,1,3,5,6,8,9,11,13,15,16,17,19,20,22,24,25],whole:[2,3,6,13,17,19],whose:7,why:[9,16,17],wiki:11,wikipedia:[0,11,20],wildli:8,wind:8,wire:13,within:[8,11,14,21],without:[2,8,11,12,15,16,19],won:[11,19,24],word:[0,3,6,8,13,20],work:[0,3,5,6,7,8,9,11,12,13,15,16,17,20,21,24,25],worker:16,worri:16,worth:6,would:[2,6,7,8,9,11,13,16,19,20,24],wrap:[3,8],wrapper:19,write:[4,5,9,11,13,15,16,17,19,20,21,24],written:[0,1,9,11,14,19,24],wrong:2,wrote:19,xrang:19,yang:19,yeah:16,year:[8,19],yet:[11,16,19,20],yield:[2,3,13,19,24],yin:21,you:[0,2,3,5,6,7,8,10,11,12,13,14,15,16,17,19,20,23,24,25],your:[2,3,8,13,19],yourself:[5,8,11],zero:[3,5,11,13,16,17,19,22,24],zerodivisionerror:19,zip:[5,6,19],zip_:3,zipper:[0,21],zstr:20},titles:["Thun 0.4.1 Documentation","Joy Interpreter","Functions Grouped by, er, Function with Examples","Function Reference","Categorical Programming","\u2202RE","Developing a Program in Joy","Using <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> to Generate Values","Thun: Joy in Python","Newton\u2019s method","No Updates","Treating Trees I: Ordered Binary Trees","Quadratic formula","Recursion Combinators","Replacing Functions in the Dictionary","Square Spiral Example Joy Code","The Four Fundamental Operations of Definite Action","Treating Trees II: <code class=\"docutils literal notranslate\"><span class=\"pre\">treestep</span></code>","Type Checking","The Blissful Elegance of Typing Joy","Traversing Datastructures with Zippers","Essays about Programming in Joy","Parsing Text into Joy Expressions","Tracing Joy Execution","Stack or Quote or Sequence or List\u2026","Type Inference of Joy Expressions"],titleterms:{"\u03bb":5,"\u03d5":5,"boolean":15,"case":[9,11],"function":[2,3,5,8,9,11,13,14,16,17,19],"long":14,"new":11,"p\u00f6ial":19,"try":5,"void":2,"while":[2,16],Adding:11,Not:15,One:[7,11],The:[6,8,11,13,15,16,17,19],There:8,Using:7,With:[5,17],about:21,action:16,add:[2,11],adding:11,address:20,alphabet:5,altern:17,ana:13,analysi:6,anamorph:[2,13],app1:2,app2:2,app3:2,appendix:[11,13,19],appli:16,approxim:9,argument:19,auto:3,averag:2,base:[9,11],binari:[2,11,17],bliss:19,both:11,branch:[2,11,15,16],brzozowski:5,can:11,cata:13,catamorph:13,categor:4,chatter:2,check:18,child:11,choic:2,clear:2,cleav:[2,16],cmp:11,code:[0,8,11,15],combin:[2,11,13,19],comment:19,compact:5,compar:11,comparison:2,compil:[7,19],compile_:19,compos:19,comput:9,con:[2,19],concat:2,conclus:[13,15,19],consecut:9,continu:8,current:11,datastructur:[5,8,11,20],deal:19,decrement:15,defin:[11,17],definit:[12,16],delabel:19,delet:11,deriv:[5,12,13,17],design:13,determin:20,develop:6,diagram:5,dialect:0,dictionari:14,dip:[2,20],dipd:2,dipdd:2,direco:7,disenstacken:2,distinguish:19,div:2,doc_from_stack_effect:19,document:0,doe:11,down_to_zero:2,drive:5,drop:2,dup:[2,19],dupd:2,dupdip:2,effect:19,eleg:19,els:11,empti:11,enstacken:2,equal:11,essai:21,euler:[6,7],eval:8,even:7,exampl:[0,2,8,11,13,15,17,18],execut:23,explor:5,express:[5,8,22,25],extract:17,factori:13,fail:18,fibonacci:7,filter:6,find:[9,11,13],finish:16,finit:5,first:[2,6,15,16,19],five:7,flatten:2,flexibl:17,floordiv:2,form:15,formula:12,found:11,four:[13,16],fsm:5,fulmin:16,fun:13,fundament:16,further:6,gcd:2,gener:[3,5,6,7,9,15],genrec:2,get:[11,17],getitem:2,given:17,greater:11,group:2,handl:16,have:[11,17],help:2,highest:11,host:0,how:[6,7],hybrid:19,hylo:13,hylomorph:13,identifi:19,ift:[2,16],iii:19,implement:[5,19],increment:15,indic:0,infer:[19,25],inferenc:19,inform:0,infra:[2,20],integ:6,interest:7,interlud:11,intern:22,interpret:[1,8,19],item:20,iter:[6,11],joi:[0,1,3,6,8,13,15,19,20,21,22,23,24,25],join:16,just:6,kei:11,kind:16,languag:0,larger:5,least_fract:2,left:11,less:11,let:[5,6],letter:5,librari:[3,8,19],like:11,list:[2,24],literari:8,littl:6,logic:[2,19],loop:[2,8,16],lower:11,lshift:2,machin:5,make:[7,9],mani:6,map:[2,16],match:5,math:2,memoiz:5,method:9,min:2,miscellan:2,mod:2,modifi:19,modulu:2,more:11,most:11,mul:[2,19],multipl:[6,7,19],must:11,name:12,neg:[2,15],newton:9,next:9,node:11,non:11,now:11,nullari:2,nulli:5,number:[13,19],one:8,onli:8,oper:16,order:[11,17],origin:15,osdn:0,other:16,our:11,out:5,over:2,pack:6,pam:[2,16],para:13,paradigm:19,parallel:16,parameter:[11,17],pars:[2,22],parser:[8,22],part:19,pass:8,path:20,pattern:13,per:11,piec:15,pop:[2,19],popd:2,popop:2,pow:2,power:7,pred:2,predic:[6,9,11,15,17],pretty_print:23,primit:13,primrec:2,print:8,problem:[6,7],process:11,product:2,program:[4,6,12,17,21],progress:19,project:[0,6,7],pure:8,put:[11,12,15,17],python:[8,14,19],quadrat:12,quick:0,quot:[2,24],rang:[2,6,13],range_to_zero:2,read:8,recur:[9,11],recurs:[11,13,17],redefin:[11,17],refactor:[6,11],refer:3,regular:[5,8],reimplement:17,relabel:19,rem:2,remaind:2,remov:2,render:6,repl:8,replac:[11,14],repres:[5,19],represent:5,reset:7,rest:[2,19],revers:[2,5,18],right:[11,20],rightmost:11,roll:[2,19],rolldown:2,rollup:2,rshift:2,rule:[5,19],run:[2,7],second:[2,19],select:2,sequenc:[7,16,19,24],set:[9,11],shorter:14,should:8,shunt:2,simpl:19,simplest:6,size:[2,14],sourc:11,special:[13,19],spiral:15,sqr:[2,19],sqrt:[2,12],squar:15,stack:[2,8,19,24],start:0,state:5,step:[2,13,17],straightforward:12,stream:5,string:5,structur:11,style:8,sub:[2,11],subtyp:19,succ:2,sum:[2,6],swaack:2,swap:[2,19],swon:2,swoncat:2,symbol:[8,13],tabl:0,tail:13,take:2,term:[6,7,17],ternari:2,text:22,than:11,them:12,thi:11,third:[2,19],three:7,thun:[0,8],time:[2,7],togeth:[11,12,15,17],token:8,toler:9,trace:[14,23],traceprint:8,trampolin:5,translat:15,travers:[11,17,20],treat:[11,17],tree:[11,17,20],treegrind:17,treestep:17,triangular:13,truediv:2,truthi:2,tuck:2,turn:15,two:[5,7],type:[18,19,25],unari:2,unbound:19,uncon:[2,19],unif:18,unifi:19,unit:2,unnecessari:6,unquot:2,unstack:2,updat:[10,19],use:19,util:[23,24,25],valu:[7,11],variabl:12,variat:7,version:[6,11,14,19],view:8,vii:19,within:9,word:2,work:[18,19],write:12,xor:2,yin:19,zero:7,zip:2,zipper:20}}) | |
\ No newline at end of file | ||
1 | +Search.setIndex({docnames:["index","joy","lib","library","notebooks/Advent_of_Code_2017_December_1st","notebooks/Categorical","notebooks/Derivatives_of_Regular_Expressions","notebooks/Developing","notebooks/Generator_Programs","notebooks/Intro","notebooks/Newton-Raphson","notebooks/NoUpdates","notebooks/Ordered_Binary_Trees","notebooks/Quadratic","notebooks/Recursion_Combinators","notebooks/Replacing","notebooks/Square_Spiral","notebooks/The_Four_Operations","notebooks/Treestep","notebooks/TypeChecking","notebooks/Types","notebooks/Zipper","notebooks/index","parser","pretty","stack","types"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst","joy.rst","lib.rst","library.rst","notebooks/Advent_of_Code_2017_December_1st.rst","notebooks/Categorical.rst","notebooks/Derivatives_of_Regular_Expressions.rst","notebooks/Developing.rst","notebooks/Generator_Programs.rst","notebooks/Intro.rst","notebooks/Newton-Raphson.rst","notebooks/NoUpdates.rst","notebooks/Ordered_Binary_Trees.rst","notebooks/Quadratic.rst","notebooks/Recursion_Combinators.rst","notebooks/Replacing.rst","notebooks/Square_Spiral.rst","notebooks/The_Four_Operations.rst","notebooks/Treestep.rst","notebooks/TypeChecking.rst","notebooks/Types.rst","notebooks/Zipper.rst","notebooks/index.rst","parser.rst","pretty.rst","stack.rst","types.rst"],objects:{"joy.joy":{joy:[1,1,1,""],repl:[1,1,1,""],run:[1,1,1,""]},"joy.library":{"void":[3,1,1,""],BinaryBuiltinWrapper:[3,1,1,""],DefinitionWrapper:[3,2,1,""],FunctionWrapper:[3,1,1,""],SimpleFunctionWrapper:[3,1,1,""],UnaryBuiltinWrapper:[3,1,1,""],add_aliases:[3,1,1,""],app1:[3,1,1,""],app2:[3,1,1,""],app3:[3,1,1,""],b:[3,1,1,""],branch:[3,1,1,""],choice:[3,1,1,""],clear:[3,1,1,""],cmp_:[3,1,1,""],concat_:[3,1,1,""],cond:[3,1,1,""],dip:[3,1,1,""],dipd:[3,1,1,""],dipdd:[3,1,1,""],disenstacken:[3,1,1,""],divmod_:[3,1,1,""],drop:[3,1,1,""],dupdip:[3,1,1,""],floor:[3,1,1,""],genrec:[3,1,1,""],getitem:[3,1,1,""],help_:[3,1,1,""],i:[3,1,1,""],id_:[3,1,1,""],infra:[3,1,1,""],initialize:[3,1,1,""],inscribe:[3,1,1,""],inscribe_:[3,1,1,""],loop:[3,1,1,""],map_:[3,1,1,""],max_:[3,1,1,""],min_:[3,1,1,""],parse:[3,1,1,""],pm:[3,1,1,""],pred:[3,1,1,""],primrec:[3,1,1,""],remove:[3,1,1,""],reverse:[3,1,1,""],select:[3,1,1,""],sharing:[3,1,1,""],shunt:[3,1,1,""],sort_:[3,1,1,""],sqrt:[3,1,1,""],step:[3,1,1,""],succ:[3,1,1,""],sum_:[3,1,1,""],take:[3,1,1,""],times:[3,1,1,""],unique:[3,1,1,""],warranty:[3,1,1,""],words:[3,1,1,""],x:[3,1,1,""],zip_:[3,1,1,""]},"joy.library.DefinitionWrapper":{add_def:[3,3,1,""],add_definitions:[3,3,1,""],parse_definition:[3,3,1,""]},"joy.parser":{ParseError:[23,4,1,""],Symbol:[23,2,1,""],text_to_expression:[23,1,1,""]},"joy.utils":{generated_library:[3,0,0,"-"],pretty_print:[24,0,0,"-"],stack:[25,0,0,"-"]},"joy.utils.generated_library":{ccons:[3,1,1,""],cons:[3,1,1,""],dup:[3,1,1,""],dupd:[3,1,1,""],dupdd:[3,1,1,""],first:[3,1,1,""],first_two:[3,1,1,""],fourth:[3,1,1,""],over:[3,1,1,""],pop:[3,1,1,""],popd:[3,1,1,""],popdd:[3,1,1,""],popop:[3,1,1,""],popopd:[3,1,1,""],popopdd:[3,1,1,""],rest:[3,1,1,""],rolldown:[3,1,1,""],rollup:[3,1,1,""],rrest:[3,1,1,""],second:[3,1,1,""],stack:[3,1,1,""],stuncons:[3,1,1,""],stununcons:[3,1,1,""],swaack:[3,1,1,""],swap:[3,1,1,""],swons:[3,1,1,""],third:[3,1,1,""],tuck:[3,1,1,""],uncons:[3,1,1,""],unit:[3,1,1,""],unswons:[3,1,1,""]},"joy.utils.pretty_print":{TracePrinter:[24,2,1,""],trace:[24,1,1,""]},"joy.utils.pretty_print.TracePrinter":{go:[24,3,1,""],viewer:[24,3,1,""]},"joy.utils.stack":{concat:[25,1,1,""],expression_to_string:[25,1,1,""],iter_stack:[25,1,1,""],list_to_stack:[25,1,1,""],pick:[25,1,1,""],stack_to_string:[25,1,1,""]},joy:{joy:[1,0,0,"-"],library:[3,0,0,"-"],parser:[23,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:exception"},terms:{"05s":6,"0b11100111011011":7,"1st":4,"23rd":20,"4ac":13,"5bkei":12,"9a9d60354c35":20,"\u03b4":6,"\u03b5":10,"abstract":[9,12],"boolean":[2,3,9,12,17],"break":[6,9,16,20],"byte":[6,7],"case":[2,3,14,17,18,20,25],"char":6,"class":[3,6,9,20,23,24,25],"const":16,"default":[3,8,12,25],"export":[3,23],"final":[2,12,14,16],"float":[9,20,21,23],"function":[0,1,4,5,7,8,11,13,16,19,21,22,23,24,25,26],"g\u00e9rard":21,"goto":6,"import":[2,4,6,7,8,10,12,13,14,15,16,18,19,20,21],"int":[6,8,9,14,16,20,21,23,25],"long":[12,16,20,22],"new":[0,2,3,6,8,9,11,14,15,16,20],"p\u00f6ial":22,"p\u00f6ial06typingtool":20,"public":11,"return":[1,3,6,7,9,12,14,15,17,18,20,23,24,25],"short":16,"static":[2,11],"super":20,"switch":[2,20],"throw":[12,26],"true":[2,3,6,7,14,16,17,20],"try":[8,10,13,14,16,18,19,20,22],"void":[0,3,16],"while":[3,6,9,12,20,23,25],AND:[6,20],Adding:[9,15,22],And:[4,6,7,8,10,12,14,16,17,20,21,25],But:[0,5,7,8,9,12,15,16,20],CPS:9,For:[0,2,3,4,12,14,15,20,22,25],Its:3,NOT:6,Not:20,One:[2,9,17,20,22],REs:6,TOS:[2,3],That:[7,12],The:[0,1,2,3,4,5,6,8,10,11,13,21,22,23,24,25,26],Then:[2,3,12,13,14,20],There:[6,13,14,16,17,18,20,25],These:[17,20,22,25],Use:[3,10,14],Used:17,Using:[0,10,12,22],With:[4,10,14,16,20,22,26],_1000:20,__add__:20,__call__:6,__class__:20,__eq__:20,__ge__:20,__hash__:20,__init__:[6,20],__main__:20,__radd__:20,__repr__:20,__str__:24,_and:6,_compaction_rul:6,_con:6,_dictionari:20,_ge:20,_infer:20,_interpret:20,_log:20,_log_it:20,_names_for:20,_or:6,_spn_e:16,_spn_p:16,_spn_t:16,_templat:6,_to_str:20,_tree_add_:12,_tree_add_e:[12,26],_tree_add_p:12,_tree_add_r:12,_tree_add_t:12,_tree_delete_:12,_tree_delete_clear_stuff:[12,26],_tree_delete_del:12,_tree_delete_r0:[12,26],_tree_delete_r1:12,_tree_delete_rightmost:12,_tree_delete_w:12,_tree_get_:[12,26],_tree_get_p:12,_tree_get_r:12,_tree_get_t:12,_tree_iter_order_curr:12,_tree_iter_order_left:12,_tree_iter_order_r:12,_tree_iter_order_right:12,_tree_t:12,_treestep_0:18,_treestep_1:18,_uniqu:20,_within_b:10,_within_p:10,_within_r:10,a10001:20,a10002:20,a10003:20,a10004:20,a_i:10,abbrevi:18,abl:[6,17,20,26],about:[0,9,12,17,20,21,25],abov:[0,6,7,10,12,14,17,20],abs:[0,10,16],absolut:9,accept:[0,1,2,3,6,7,8,9,12,13,15,16,17,18,20,21],accord:6,accordingli:[12,17],accumul:7,act:[6,26],action:[0,9,15,16,20,21,22],actual:[2,7,9,12,17,20],adapt:[16,22],add:[3,4,6,7,8,9,15,20,24,26],add_alias:3,add_def:3,add_definit:[3,12,18],add_if_match:4,added:[5,12],adding:[11,20],addit:[0,2,3,7,9,14,15,18],address:22,adjust:12,advantag:20,advent:4,affect:[3,17],after:[4,6,7,8,9,14,17,20,26],afterward:9,again:[2,3,7,9,12,14,20],against:20,aggreg:21,ahead:20,aka:[6,9,21,26],albrecht:0,algorithm:[6,9,20],alia:3,alias:[3,9],align:[9,24],all:[3,4,6,7,8,9,12,14,15,16,17,18,20,24],alloc:20,allow:[11,12,17],almost:12,along:[6,9,14,20],alphabet:[3,22],alreadi:[6,10,15,20,21],also:[0,6,7,9,12,17,20,24,25],alter:[6,20],altern:[5,20],although:[4,5,12],altogeth:8,alwai:[7,11,14,17],amend:17,among:20,amort:12,analysi:[5,22],anamorph:[9,22],ani:[0,5,6,7,9,11,12,16,17,20,21,23],annual:9,anonym:12,anoth:[4,6,12,17,20,25,26],anyhow:[17,20],anyjoytyp:20,anymor:20,anystarjoytyp:20,anyth:[2,3,6,9,20,26],aoc2017:4,apart:20,api:11,app1:3,app2:[3,9,13,14,15,17],app3:[3,17],app:9,appear:[2,5,6,7,12],append:20,appendix:22,appli:[2,3,7,8,12,14,16,20],applic:8,approach:7,appropri:6,approxim:22,archiv:0,aren:21,arg:[2,3,16],argument:[2,3,9,10,13,14,16,22,24,25],arithmet:2,ariti:[2,17],around:[7,20,23,25],arrang:[16,18],arriv:[8,18],arrow:6,articl:[0,5,8,14],ascii:6,ascii_lowercas:6,ask:[5,8,20],aspect:0,assembl:[6,16],assert:[6,20],assign:[17,25],associ:12,assum:[4,10],asterisk:18,asterix:[20,26],asyncron:17,attack:9,attempt:[0,1,20],attribut:3,attributeerror:20,author:20,auto:[0,20,26],automat:[5,17,20],auxiliari:[6,18],avail:[0,20,26],averag:[9,15],avoid:12,awai:[12,20],awar:2,awkward:[12,14,20],azur:22,back:[3,12,20],backtrack:26,backward:[11,12,13,18],bad:20,bag:9,banana:14,bar:17,barb:14,base:[0,2,3,11,14,18,20],basic:[2,3,4,9,12],basicconfig:[19,20],becaas:6,becaus:[2,3,4,6,9,12,17,18,20,21,25],becom:[0,4,12,16,18,25],becuas:20,been:[6,10,11,12,20,21],befor:[6,8,9,12],begin:[12,18],behavior:[11,18,26],behaviour:[0,1,20],behind:17,being:[0,17],below:[2,3,6,7,8,12,16,20,21],bespok:9,best:0,better:[7,12,14,20],between:[0,7],beyond:8,biannual:9,bin:6,binari:[0,8,9,22],binary_search_tre:12,binarybuiltinwrapp:3,bind:9,bingo:21,bit:[6,7,8,12,20],blank:23,bliss:[0,22],block:7,bodi:[2,3,6,9,12,17],body_text:3,booktitl:20,bool:[14,20,26],borrow:[9,20],both:[2,7,9,13,14,15,16,17,20,25],bottom:8,bounce_to:6,bracket:[9,20,23],branch:[3,4,6,7,8,14,20,22,26],branch_fals:20,branch_tru:20,breakpoint:9,brief:4,bring:[7,9,20],bruijn:20,brutal:17,brzozowski:[20,22],brzozowskian:6,btree:[12,18],buck:12,bug:[0,9],build:[8,9,13,14,16,21,25],built:[13,20],bundl:[2,3,14],burgeon:9,calculu:5,call:[1,2,6,9,11,12,14,17,20,24,25],caller:[12,20],can:[0,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,20,21,22,23,25,26],cancel:17,cannot:[19,20,23],captur:9,card:9,care:[7,25],carefulli:21,carri:[4,8,12],cartesian:5,catamorph:22,categor:[0,22],categori:[5,17],ccc:5,ccon:[3,12,19,20,26],cell:[14,20],certain:[9,25],certainli:12,chain:[3,17],challeng:22,chang:[2,11,12,16,20,21],charact:[6,21],chat:9,chatter:[0,20],check:[0,8,10,20,22],child:18,choic:[3,14],choos:11,chop:13,chose:6,cinf:12,circl:6,circuit:[5,16],circular:4,cite_not:12,classmethod:3,claus:[3,20],clean:20,clear:[3,7,9],clear_stuff:12,cleav:[4,9,13,15],close:[0,1,5],clunki:[7,20],clv:17,cmp:[3,18,22],cmp_:3,code:[1,5,6,13,14,17,20,22,26],codireco:[8,10,16],collaps:14,collect:[5,6,8,9,20],combin:[0,3,7,8,9,10,13,16,17,18,21,22,24,26],combinatorjoytyp:20,come:[9,12,20],command:[4,9,12,20],comment:17,common:[2,7,17],compar:[3,5,6,16,20],comparison:[0,12],compat:17,compel:5,compil:[2,5,6,9,12,15,17,22,26],complement:6,complet:5,complex:[3,17,20,21,26],complic:20,compos:[6,26],composit:20,compostit:20,compound:12,comput:[2,5,6,7,9,13,16,17,20,26],con:[3,6,7,8,9,10,12,13,14,16,17,18,21,25,26],conal:[5,17],concat:[3,4,8,9,17,18,20,25],concat_:3,concaten:[0,6],concatin:[0,3,6,25],concern:17,conclus:22,concurr:2,cond:[3,12],condit:[3,9],condition:16,confer:20,conflict:[12,20],consecut:22,consid:[6,7,8,12,14,18,20,21],consist:[2,8,9,17,18],constant:12,constitu:14,constraint:16,construct:[0,16,17,20],consum:[16,17,20],contain:[0,2,3,6,8,9,14,16,20,23],content:20,context:2,conting:12,continu:[0,6,14,20,21],control:9,conveni:[5,17,20],convent:17,convers:20,convert:[14,15,18,20,23,25],cool:12,coordin:[0,16],copi:[2,3,4,7,12,14,16,17,18,19,22],copyright:9,correspond:[5,17],could:[2,5,6,7,9,11,12,17,20,21],couldn:17,count:[3,20],counter:[7,20],coupl:18,cours:[7,12,20],cout:16,cover:20,cpu:17,crack:12,crash:12,creat:[0,2,3,4,7,10,12,17,20],creativ:20,crude:[12,20,23],cruft:20,curent:26,current:[2,3,9,14,16,17,18,20,21,24,26],curri:6,custom:11,cycl:[7,8],cython:9,d010101:6,d0101:6,d01:6,d10:6,d_compact:6,dai:9,data:[2,3,6,14],datastructur:[0,2,14,20,22,23,25],datatyp:25,ddididi:21,deal:[0,4,6,12,17],dealt:20,debugg:20,decemb:4,decid:12,declar:20,decor:3,decoupl:14,decrement:[0,3],deduc:[7,20],deeper:0,deepli:5,def:[3,6,9,14,15,20,25],defaultdict:[6,20],defi:3,defin:[2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,20,21,22],definit:[0,2,3,7,8,9,11,12,14,16,18,20,22,26],definitionwrapp:[3,12,14,18],defint:17,del:19,deleg:9,delet:22,deliber:20,demo:20,demonstr:5,depend:[3,12,14,17],deposit:18,depth:[20,26],dequot:[4,14],der:12,deriv:[2,3,4,7,9,10,12,20,22],derv:6,describ:[3,5,6,12,14,17,18,20,23],descript:[7,9],descriptor:20,design:[2,3,12,17,22],desir:[9,18],destin:6,destruct:12,detail:[9,12,20],detect:[6,8,12,14,20],determin:22,develop:[0,8,9,20,22],diagram:7,dialect:1,dict:[1,3,6,20,24],dictionari:[0,1,3,9,20,22,24],did:20,differ:[0,5,7,10,12,13,14,17,25],differenti:5,difficult:20,difficulti:17,dig:[12,21],digit:[4,7],digraph:6,dinfrirst:[9,16,20,26],dip:[0,3,7,8,9,10,12,13,14,15,16,17,18,20,22,26],dipd:[3,8,9,12,13,14,16,17,20,21,26],dipdd:[3,12],direco:22,direct:9,directli:[7,17,18,20,25],disappear:[2,6,20],discard:[3,8,10,12,14],disciplin:12,disctionari:1,disenstacken:[3,9],disk:9,displac:2,displai:20,distiguish:20,distribut:17,ditch:12,div:[3,9,20,26],dive:18,divis:[12,20],divmod:[3,26],divmod_:[3,20],doc:[2,3,9,20],doc_from_stack_effect:19,docstr:20,document:[20,22,23,25],doe:[0,1,3,5,6,8,9,15,17,20,22,24,26],doesn:[4,7,11,12,16,17,18,20,25],doing:[5,7,9,17,20,21],domain:[5,20],don:[6,7,9,12,20],done:[2,7,9,11,20],dooooc:20,door:9,dot:[6,24],doubl:[3,6,7,9,20],doublecircl:6,down:[2,6,10,14,21,26],down_to_zero:9,dozen:9,draft:[5,11],dream:9,drive:[8,10],driven:7,driver:[6,8],drop:[3,4,12],dudipd:9,due:[4,20],dup:[3,4,7,8,9,10,12,13,14,16,17,19,21,25,26],dupd:[3,20,26],dupdd:[3,26],dupdip:[3,7,12,13,14,16],duplic:[3,12,14],durat:2,dure:[2,14],each:[2,3,4,5,6,7,9,14,15,16,17,18,20,24,26],easi:[0,12,16,18,20,21],easier:[3,4,12,17],easili:5,eat:6,edit:22,effect:[2,3,6,9,17,21,22,26],effici:[8,15,21],efg:20,either:[1,2,3,6,12,14,20],elabor:20,eleg:[0,6,9,12,17,22],element:[2,3],elif:20,elimin:[6,20],elliott:[5,17],els:[2,3,4,6,14,16,17,20],else_:20,embed:[5,12,21],emit:20,empti:[3,6,9,18,20,25,26],encapsul:9,enclos:9,encod:8,encount:20,end:[6,7,12,14,18,20,25],endless:8,enforc:[2,9],engend:9,enough:[6,9,14,24,26],enstacken:[8,9,20],enter:[3,9],enter_guard:20,entir:25,entri:[3,21,24],enumer:20,epsilon:10,equal:[3,7,18,25],equat:[9,10],equival:17,ergo:[6,12],err:[12,19],error:[9,20,23],essai:0,establish:20,etc:[3,18,20,21,23],euler:22,euro:20,eval:[0,20],evalu:[1,2,3,4,9,10,12,13,14,15,17,18,20,24],event:17,eventu:[17,20],ever:20,everi:[1,8,17],everybodi:17,everyth:[3,6,12,13,17,20],evolv:11,examin:14,exampl:[3,6,7,20,22,23,25,26],exce:8,except:[6,9,12,19,20,23],execut:[0,1,2,3,9,14,15,17,18,20,21,25,26],exend:20,exercis:[6,12],exist:[5,12,20],expand:12,expect:[2,3,17,18,20,25],experi:[9,18],explain:20,explan:9,explor:[9,20],express:[0,1,2,3,5,12,14,15,16,20,21,22,24,25],expression_to_str:[20,25],extend:20,extra:[4,7,8],extract:[12,13,22],extrem:9,extrememli:9,f_g:20,f_in:20,f_out:20,f_python:20,facet:0,facil:9,fact:23,factor:[2,7,9,12,16,20],factori:[3,22],fail:[2,3,12,22,23],fail_fail:3,fairli:20,fake:6,fall:20,fals:[2,3,6,7,14,16,17,20],falsei:20,familiar:[0,16],far:[10,12,14,20,26],fascin:0,favorit:17,fear:[12,20],few:[7,9,10,13,17,20],fewer:[3,9],fg_in:20,fg_out:20,fib:8,fib_gen:8,fibonacci:22,figur:[2,3,12,14,20],file:16,filter:12,fin:7,find:[2,3,4,6,7,8,17,18,20,22,26],finder:10,fine:[0,6,7,12,20,26],finite_state_machin:6,first:[3,4,6,8,9,10,12,13,14,15,18,21,22,26],first_two:[3,12,26],fit:[7,9],five:[7,9,22],fix:[2,3,6,14,20],fixm:[6,20],flag:[17,20],flatten:[9,18,20],flesh:6,flexibl:22,floatjoytyp:20,floatstarjoytyp:20,floor:3,floordiv:[7,26],flow:9,follow:[0,2,3,6,9,11,14,17,18,20,21],foo:[9,11,12,17,20],foo_ii:11,fork:17,form:[2,3,5,6,7,8,14,18,20,22,25],forman:9,format:[19,20,22,24],formula:[0,7,22],forth:[4,9,20],forum:0,forward:20,found:9,four:[0,2,3,7,8,9,12,16,22],fourteen:7,fourth:[2,3,4,12,14,26],frac:[10,13],fractal:9,fraction0:9,fraction:[2,9],frame:14,framework:9,free:[5,9,12],freeli:2,from:[0,1,2,3,4,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,25],from_:6,front:[2,3,14],frozenset:6,ftw:[0,22],fulin:17,full:7,fun:[6,22],func:20,functionjoytyp:20,functionwrapp:3,functool:6,fundament:[0,22],funtion:12,further:[10,20,22],futur:17,g_in:20,g_out:20,garbag:9,gari:12,gcd:9,gener:[0,2,5,14,17,20,22,25,26],generated_librari:3,genrec:[3,9,12,14,17,18,20],geometr:7,get:[2,5,6,7,8,9,13,14,20,22],getch:6,getitem:3,getrecursionlimit:25,getsourc:9,ghc:5,give:[5,7,12,14,16,18,20,25],given:[2,3,4,7,8,10,12,14,16,17,20,21,22],global:[19,20],glue:9,goe:26,going:[6,12,13,16,17,18,20,21],good:[7,12,20],grab:20,grammar:23,grand:9,graph:17,graphic:6,graphviz:6,great:[0,4,9,20,22],greater:25,grind:20,group:0,grow:6,gsra:10,guard:[12,20],had:[6,7,21],haiku:9,half:[7,20,21],half_of_s:4,halfwai:4,hallmark:17,hand:[6,9,15,20,22],handi:[10,20],handl:[12,20,25,26],happen:[9,20],happi:6,hard:[6,20,21],hardwar:5,has:[0,2,3,6,8,9,10,11,12,14,17,20,21,25],hasattr:20,hash:20,haskel:5,have:[2,3,4,6,7,8,9,10,11,14,15,16,17,20,21,22,25,26],head:25,heh:20,help:[0,9,12,14,16,20],help_:3,helper:[3,6],herd:9,here:[0,6,7,8,12,16,18,20,21,26],heurist:4,hide:12,hierarchi:20,higher:[6,9,12,20],highli:9,hij:6,histori:[20,24],hit:6,hmm:[6,12],hoist:3,hold:[7,20],hood:12,hope:[0,7,9,22],hopefulli:14,host:22,how:[0,5,6,10,12,14,16,20,21,22],howev:[14,15,17,20],html:[2,3,8,13,14,22],http:[12,26],huet:21,huge:12,hugh:[10,18],human:9,hybrid:[16,26],hylomorph:22,hypothet:2,id_:3,idea:[5,7,9,20],ident:[3,6,14,20,26],if_not_empti:12,ift:[0,3,4,12,14,16,18,20,26],ignor:[1,3,12,20],iii:22,illustr:[6,14],imagin:[6,17,21],imap:20,imit:[6,18],immedi:[6,14],immut:[6,9,12],imper:14,implement:[0,1,2,3,5,9,11,12,14,15,17,22,26],implementaion:17,implicit:9,improv:20,includ:[5,12,17,18,20,26],inclus:7,incom:25,incompat:11,incorpor:13,increas:7,increment:[0,3,5,7,11,17],index:[0,9,20,25],indexerror:25,indic:[17,18,20,26],ineffici:20,infer:[0,19],inferenc:26,info:[19,20],inform:[3,6,20,26],infra:[3,8,9,12,13,15,16,17,18,20,22,26],infrastructur:3,initi:[2,3,6,9,10,12,20],inlin:12,inner:20,inproceed:20,input:[1,4,10,17,19,20],input_:6,inscrib:3,inscribe_:3,insert:20,insight:14,inspect:9,inspect_stack:20,instal:0,instanc:20,instanti:[5,24],instead:[6,7,8,12,14,16,20,21,25,26],instruct:6,integ:[0,2,3,4,9,14,16,18,20,23],integr:3,intend:[0,9],interact:[9,22],interest:[0,7,12,20,22],interfer:17,interlud:22,intermedi:14,intern:[0,20,24,25],interpret:[0,5,11,15,23,24,26],interrupt:9,intersect:6,interspers:17,interv:[5,7],intjoytyp:20,introduc:11,introduct:0,intstarjoytyp:20,intuit:20,invari:3,invent:20,involv:20,ipf:9,ipython:20,isinst:[6,20],isn:[6,12,21],issubclass:20,item:[2,3,4,9,12,14,17,18,20,22,25],iter:[1,3,6,9,14,17,18,20,22,25],iter_stack:[15,25],iteritem:[6,20],itertool:[6,20],its:[0,1,2,3,5,7,9,12,14,16,17,18,20,25],itself:[0,2,9,12,17,20],j05cmp:[2,3,14],jaanu:20,jmp:6,job:[17,22],john:[10,18],joi:[2,5,11,12,13,15,17,19],join:[6,20],joypi:[21,26],joytypeerror:19,jump:6,jump_from:6,junk:20,jupyt:22,just:[0,2,3,4,6,8,9,11,12,14,16,17,18,20,21,24],juxtaposit:17,keep:[6,12,13,17,20,21],kei:[6,18,22],kevin:0,key_n:12,keyerror:[6,12,20],kind:[0,2,5,9,12,14,16,18,20,26],kinda:20,kleen:[18,20],kleenestar:20,kleffner:20,know:[7,12,20],knowledg:20,known:[5,17],kstar:6,l_kei:12,l_left:12,l_right:12,l_valu:12,label:[6,20],lambda:[5,6,20],languag:[3,5,6,9,11,12,15,20],larg:[6,20],larger:[22,25],largest:3,last:[4,7,12,14,20],lastli:8,later:[6,9,16,18,20],law:2,layout:[0,16],lazi:20,lazili:10,lcm:7,lead:[6,9,20],leaf:12,lean:9,learn:0,least:[2,7,14,20,25],least_fract:9,leav:[3,7,16,17],left:[6,9,13,14,17,18,20,21,24,25],leftov:14,legend:6,legibl:[0,16],len:[6,20],length:[3,7,25],lens:14,less:[7,8,9,14,20,25],let:[4,8,10,12,13,14,16,18,20,21,22],letter:20,level:[5,6,12,19,20],librari:[0,6,15],like:[0,2,3,6,7,9,16,17,18,20,22,23,24,26],limit:[20,26],line:[3,9,12,13,20,24,26],linear:25,link:[0,6,20],linux:0,list:[0,3,4,6,7,9,10,12,14,17,18,20,21,24],list_to_stack:[20,25],liter:[1,12,18,20,21,23],literatur:20,littl:[0,6,8,12,16,17,20,22],live:22,lkei:18,load:[7,9],local:20,locat:2,locu:24,log:[19,20],log_2:12,logic:[0,7,16,22],longer:[12,20],look:[1,6,8,9,10,12,13,16,17,20],lookup:9,loop:[0,1,3,6,7,20,22,26],lose:20,lot:[6,9,12,20,21],love:7,low:[5,6],lower:7,lowercas:[6,20],lowest:12,lshift:26,machin:[0,22],machineri:[12,20],macro:9,made:[0,9,17,20,21],magic:20,mai:[2,14,17,26],mail:0,main:[0,3,4,9,13,16,17,20,21],mainloop:11,maintain:21,major:11,make:[2,3,4,5,7,9,12,14,15,16,17,18,20,21,22],make_gener:[10,16],make_graph:6,manfr:[0,2,3,5,14],mani:[0,6,9,20],manipul:20,manner:13,map:[1,3,6,7,9,11,14,18,20,24],map_:3,marker:9,mask:[7,8,16],match:[0,1,4,20,22],materi:0,math:[0,9,10,12,13,20],mathemat:9,matter:[4,7,10,12,18],max_:3,maximum:3,mayb:[12,20],mean:[5,7,9,10,12,14,18,20,25],meant:[9,12,14,18],mem:6,member:[2,3,14],memo:6,mental:9,mention:2,mercuri:0,mess:20,messag:[19,20],meta:[9,12,15],meta_compos:20,method:[0,3,9,20,22,24],midpoint:7,might:[0,4,5,6,8,12,16,20],mike:12,million:8,min_:3,mind:20,minimum:3,minor:12,minu:3,mirror:0,miscellan:0,mismatch:20,mix:[9,20],mnemon:4,mod:3,mode:20,model:[5,9],modern:0,modif:[8,20],modifi:[9,12,21],modul:[0,1,3,9,20,23],modulo:20,modulu:[9,26],moment:20,month:9,more:[0,3,5,6,7,8,9,10,14,15,17,18,20,23,25,26],most:[6,20,26],mostli:0,move:[4,6,12],movement:2,much:[6,7,8,12,14,20],muck:12,mul:[3,9,13,19,21,24,26],multi:3,multipl:[22,26],multipli:3,must:[2,3,7,11,14,17,18,20,23],myself:20,n10001:20,n10002:20,n10003:20,n1001:20,n1002:20,n1003:20,name:[1,3,4,6,9,11,12,14,20,21,22,23,24,25,26],narr:20,natur:[6,7,8,12,20],navig:21,nearli:20,neat:12,neato:20,necessarili:20,need:[2,3,4,7,8,10,11,12,14,16,17,20],neg:[3,13,26],neither:[17,20],ness:6,nest:[3,9,12,21],net:26,network:9,never:[6,11,14],new_def:20,new_f:20,new_fo:20,new_kei:12,new_valu:12,newton:[0,22],next:[0,6,7,16,17,18,20,22,26],nice:[0,4,6,14,25],niether:2,node:[6,18,22],node_kei:12,node_valu:12,non:[6,18,20],none:[1,3,20],nope:18,nor:6,normal:17,notat:[0,9,12,16],note:[2,6,7,10,12,14,17,20,25],notebook:[7,8,9,20,21,22],notebook_preambl:[2,4,7,8,10,12,13,14,15,16,18,20,21],noth:[2,12,17],notic:7,now:[3,4,6,7,8,9,14,15,18,20,22],nth:[3,25],nullari:[9,12,16,17,20,26],number:[0,1,2,3,7,8,10,16,17,25,26],numberjoytyp:20,numberstarjoytyp:20,numer:20,object:[6,20,23],observ:7,obviou:8,obvious:20,occur:12,odd:[7,8],off:[2,3,7,8,13,16,20,21],often:[6,17],old:[2,15],old_k:12,old_kei:12,old_valu:12,omg:6,omit:[14,20,23],onc:[3,6,11,12],one:[0,2,3,4,6,7,8,12,14,16,17,18,20,24,25,26],ones:[6,8,20],onli:[2,3,4,6,7,12,14,16,17,20,21,25],onto:[1,2,3,9,14,25],open:[9,20],oper:[0,3,6,9,12,14,22,25],oppos:[4,20],optim:12,option:[1,9,12,20,25],orchestr:17,order:[0,2,3,4,9,14,17,19,20,22,25],org:[0,12],origin:[0,1,2,3,4,12,21,22],osdn:26,other:[0,2,3,5,6,9,12,14,16,18,20,25],otherwis:[3,6,7,8,12,18,20],our:[4,6,7,8,9,10,14,16,18,20],out:[2,3,5,7,8,9,10,12,13,14,16,17,20,21,22],outcom:18,outlin:6,output:[6,10,14,17,19,20,26],outsid:5,over:[3,4,5,7,8,9,10,12,13,17,18,20,22,26],overhaul:20,overview:[3,20],own:[12,20],pack:25,packag:[0,9],page:[0,12,20,25],pair:[0,2,3,4,7,8,12,16,20],pair_up:4,palidrom:7,palindrom:7,pam:9,paper:[5,9,14,17,21],paradigm:22,parallel:[2,22],paramet:[1,2,3,14,15,23,24,25],parameter:22,paramorph:14,parenthes:[12,25],pariti:8,pars:[0,3,6,9],parse_definit:3,parseerror:23,parser:[0,19,20],part:[2,3,10,14,18,22],partial:[6,20],particular:21,pass:[0,6,12,20,24],patch:6,path:[6,16,20,22],pattern:[6,7,17,18,22],pe1:[7,8],pe2:8,pearl:21,pend:[3,9,14,20,21,24],peopl:22,per:[9,18],perfectli:17,perform:[6,17,20],perhap:8,period:9,permit:[17,20,25],permut:20,persist:[3,12],phase:2,phi:6,phrase:16,pick:[7,8,17,25],pickl:9,pictur:12,piec:[14,22],pip:0,place:[3,7,9,20],plai:0,plu:3,plug:[8,14,18],point:[5,6,9,12,14,16,17],pointless:2,pool:17,pop:[0,3,4,6,7,8,9,12,14,15,16,18,19,25,26],popd:[3,9,10,12,15,17,20,26],popdd:[3,8,13,20,26],popop:[3,4,7,8,9,10,12,18,20,26],popopd:[3,26],popopdd:[3,26],posit:[3,7,9,14],possibilit:12,possibl:[12,18,20,22],post:9,poswrd:20,potenti:17,pow:26,power:[9,20],pprint:6,pragmat:7,preambl:10,preceed:17,precis:[0,1],pred:[3,20,26],predecessor:3,predic:[2,3,6,8,14,17],prefix:[20,24],preliminari:6,present:20,preserv:[5,18],pretti:[10,12,13,17,18,20,24,25],pretty_print:0,previou:[9,17],prime:10,primit:[2,3,20,22],primrec:[3,8,9,10,14],print:[0,1,2,3,6,19,20,24,25],probabl:[4,8,9,12,20],problem:[9,16,20,22],proc_curr:12,proc_left:12,proc_right:12,proce:[4,7,26],process:[6,9,18,20,24],produc:[3,4,7,12,14,18,20],product:[6,8,9,19,20],program:[0,2,3,4,8,9,10,12,14,16,17,20,21],programm:[17,20],progress:17,project:[22,26],prolog:20,promis:17,prompt:9,proper:[2,3,14,17,26],properti:0,provid:[0,3,5,9,17,20,26],pseudo:16,pun:[0,9],punctuat:20,pure:[0,6],puriti:9,purpos:9,push:[2,3,9,14,21,25],put:[1,2,8,9,17,20,22,25],puzzl:4,pypi:0,python3:9,python:[0,2,3,6,12,14,17,21,22,23,25,26],quadrat:[0,22],quasi:16,queri:[12,18],query_kei:18,queu:14,quit:[0,18],quot:[0,3,8,9,12,13,14,16,17,18,20,21,24],quotat:[2,3,14],quotient:3,r_kei:12,r_left:12,r_right:12,r_valu:12,rais:[6,12,20,23,25],rang:[6,9,20],range_revers:14,range_to_zero:9,ranger:14,ranger_revers:14,rankdir:6,raphson:10,rather:[7,9,14,16,18],ratio:9,reach:[6,7,8,14],read:[0,1,7,8,12,20,21],readabl:15,reader:[6,12],readi:20,readm:16,real:12,realiz:[4,5,12,16],rearrang:[2,12,20],reason:[7,9,17,20],rebuild:[18,21],rec1:[2,3,14],rec2:[2,3,14],recent:20,recogn:23,recombin:17,record:[9,24],recur:[3,14,20],recurs:[0,2,3,6,8,9,10,17,20,22,25],recus:9,redefin:22,redistribut:[3,9],redo:6,reduc:[2,20],redund:25,refactor:[0,9,11,22],refer:[0,2],referenti:17,reflect:17,regard:17,region:16,regist:2,regular:[20,22,23],reifi:19,reimplement:[17,22],relat:[6,20],releas:11,remain:[2,9,11,20],remaind:[3,10],rememb:6,remind:20,remov:[3,12,20,25,26],render:22,repeat:[4,7],repeatedli:7,repetit:6,repl:[0,1],replac:[0,2,3,8,13,14,17,18,20,21,22,25],repositori:0,repr:[6,20],repres:[2,9,12,17,23,24],represent:25,reprod:8,repurpos:20,requir:[16,17,20,25],res:20,research:20,resembl:9,resolut:17,resourc:[3,17],respect:[6,7,17],rest:[3,7,8,9,12,14,16,21,22,25,26],rest_two:12,restart:3,restor:2,result:[1,2,3,6,7,12,13,14,17,18,20,21],resum:9,retir:2,retri:9,reus:[12,20],revers:[3,4,7,8,14,20,21,22,25],revisit:20,rewrit:[3,9,16,20],rewritten:9,rid:12,right:[8,9,13,18,20,22,24,25],rightest:12,rightmost:7,rigor:17,risk:20,rkei:18,rob:20,roll:[3,10,12,18],roll_dn:20,rolldown:[3,19,20,26],rollup:[3,20,26],root:[3,10,13],rotate_seq:4,rough:16,round:[4,20],row:6,rrest:[3,19,20,26],rshift:26,rule:[17,22],run:[0,1,3,7,9,10,12,13,14,16,17,18,20,21],runtim:17,runtimeerror:25,sai:[6,8,12,13,16,18,20],same:[2,5,7,12,17,20,25],sandwich:[2,3,14],save:[2,6,7,9],scan:3,scanner:[9,23],scenario:21,scm:26,scope:[4,8,12],search:[0,12],sec:20,second:[3,4,9,12,14,16,18,25,26],section:14,see:[0,6,8,9,10,11,13,14,15,16,20,21,24],seem:[0,7,9,16,18,20,26],seen:[20,21],select:3,self:[6,17,20],semant:[2,3,9,11,12,17,20],semi:9,send:9,sens:[0,2,7,20,21],separ:[9,17,20,23],seq:20,sequenc:[0,1,2,3,4,7,9,12,14,15,21,22,23,26],sequence_to_stack:20,seri:[7,8,12,16,21],ses:20,set:[2,3,6,14,20,22],seven:[7,8],sever:[0,5,9,14],shape:[6,17],share:[3,9],shelf:2,shew:6,shift:[7,8],shorter:22,shorthand:12,should:[2,3,6,7,12,14,17,20],shouldn:9,show:[5,16,17,20,21],shunt:[3,21],side:[6,12,19,20,26],sign:3,signatur:26,signifi:[9,12],similar:[12,16,18,20],simon:9,simpl:[6,9,14,16,25,26],simplefunctionwrapp:[3,15,20],simpler:18,simplest:[20,22],simpli:5,simplifi:[7,12,21],sinc:[2,7,12,16,20],singl:[3,8,9,15,16,17,20,23,26],singleton:6,situ:12,situat:12,six:[7,8,9],sixti:[7,8],size:[4,6,9,22],skeptic:9,skip:20,slight:10,slightli:[12,14,20],small:4,smallest:3,smart:12,softwar:9,solei:2,solut:[7,8],solvabl:9,some:[0,2,3,6,8,9,12,14,16,17,18,20,22,25,26],somehow:[12,20],someth:[2,4,11,12,20],sometim:12,somewher:[12,22],sort:[3,6,12,17,20],sort_:3,sourc:[0,1,3,20,22,23,24,25],space:[7,24],span:7,spawn:20,special:[8,12,22],specif:[0,5],specifi:[12,17],speed:15,spell:[6,18],sphinx:[22,25],spiral:[0,22],spiral_next:16,spirit:[0,1,18],split:[6,20],split_at:4,sqr:[3,9,10,13,21],sqrt:[3,10,20,26],squar:[0,3,10,20,22,23],stack:[0,1,3,7,8,10,12,13,14,15,16,17,18,19,21,22,23,24,26],stack_effect:20,stack_effect_com:20,stack_to_str:[19,25],stacki:20,stackjoytyp:20,stackoverflow:16,stackstarjoytyp:20,stage:18,stai:[0,1],stand:[5,6],standard:[9,12],star:[18,20],stare:12,start:[6,7,8,9,10,12,14,18,20,26],state:[9,22],state_nam:6,statement:[3,6,16],stdout:[19,20],step:[3,4,7,9,12,15,20,21,22],step_zero:4,stepper:16,still:[6,12,20],stop:12,stopiter:6,storag:[7,12],store:[7,14,20],stori:14,str:[1,6,20,23,24,25],straightforward:[4,6,8,10,16,20,22],stream:[7,19,20],stretch:12,string:[1,2,3,4,9,20,21,22,23,24,25],stringi:6,structur:[9,17,18,20,21,22,25],stuck:6,studi:6,stuff:[12,20],stuncon:[3,26],stununcon:[3,26],style:[0,5,20],sub:[11,17,26],subclass:9,subject:[17,21],subsequ:17,subset:[20,26],substitut:[6,12,20],subtract:7,subtyp:22,succ:[3,20,26],succe:20,success:10,suck:20,suffic:20,suffici:12,suffix:20,suggest:[5,6,12],suitabl:[3,5,7],sum:[3,4,8,9,13,14,15,18],sum_:[3,20],summand:7,sumtre:18,suppli:[12,23],support:[9,20,24,25],sure:17,suspect:2,svg:6,swaack:[3,13,15,16,20,21,26],swap:[3,4,7,8,9,10,12,14,15,16,17,18,19,21,26],swon:[3,8,9,14,18,20,21,26],swoncat:[8,9,10,14,18],swuncon:14,sym:6,symbol:[1,2,3,6,17,20,21,22,23],symboljoytyp:20,symmetr:[7,12,16],symmetri:[6,16],syntact:9,syntax:[9,25],sys:[19,20,25],system:[9,12,17],tabl:[6,20],tag:[6,20,26],tail:[12,20,22,25],tailrec:3,take:[3,4,6,7,9,10,12,14,16,17,20,25],talk:[9,12,20,25],target:21,tast:5,tbd:9,tear:14,technic:2,techniqu:[5,21],technolog:2,temporari:21,ten:7,term:[1,2,6,9,10,14,17,20,22,23,25,26],termin:[2,3,6,14],ternari:9,test:[2,3,14],text:[0,1,3,20],text_to_express:[9,19,23],textual:9,than:[0,3,6,7,8,9,10,14,17,18,20,25,26],thei:[2,6,7,8,9,12,14,16,17,20,21,23,25],them:[0,2,3,6,7,8,12,14,16,17,20,21,22,26],themselv:[17,20],theori:[2,3,14,17],therefor:8,thi:[0,1,2,3,4,5,6,7,8,9,10,13,14,16,17,18,20,21,22,23,24,25,26],thing:[2,8,12,14,17,20,21,23,25,26],think:[2,7,9,12,14,17,18,20],third:[3,4,8,9,12,26],thirti:7,those:[2,3,6,12,14,16,20,22,26],though:[7,17],thought:[9,17],thousand:7,thread:[2,17],three:[2,3,6,7,9,12,13,16,18,20,22],through:[1,7,9,18,20,21,25,26],thu:4,thun:[2,3,5,11,14,17],thunder:9,thunk:17,time:[3,6,7,9,10,12,14,16,17,20,21],titl:20,to_check:6,to_set:12,todai:9,todo:[9,23],togeth:[8,9,17,20,22],token:23,toler:22,too:[6,14,20],tool:[9,20],tooo:20,top:[2,3,9,14,20,24,25],total:[4,7],total_match:4,tower:20,trace:[0,9,13,14,16,21,22,25],traceback:20,traceprint:24,track:[13,20,21],tracker:0,transform:5,transit:6,translat:[5,13,20,22],trap:6,travers:[0,22],treasur:0,treat:[0,2,3,14,20,22],treatment:8,tree:[0,9,22],treegrind:22,treestep:[0,22],tri:7,triangl:17,triangular_numb:14,trick:[7,20],tricki:20,trobe:0,trove:0,truediv:26,truthi:[3,9,17,20],tuck:[3,9,20,26],tupl:[3,6,9,20,25],turn:[2,3,6,20,22],twice:[12,14],two:[0,2,3,7,9,10,12,13,14,16,17,18,19,20,21,22,25,26],txt:3,type:[0,1,5,9,12,14,17,22,23,24,25],typeerror:20,typeless:20,typic:[2,3,13,14],ulam:[0,16],unari:9,unarybuiltinwrapp:3,unbalanc:[12,23],unbound:26,unchang:12,uncompil:20,uncon:[3,4,8,9,12,14,18,21,26],under:[2,3,9,12],underli:[6,17,20],underscor:20,understand:[0,12],undistinguish:12,undocu:9,unfinish:6,unfortun:25,unicod:20,unif:[20,22],unifi:19,union:6,uniqu:[3,6,12,20],unit:[3,4,9,14,17,26],univers:[0,9,17,20],unlik:17,unnecessari:22,unnecesssari:20,unpack:[2,3,12,25],unpair:7,unquot:[9,16,18,23],unread:[0,16],unrol:6,unstack:20,unswon:[3,26],untangl:14,until:[6,8,17],unus:7,unusu:12,unwrap:6,updat:[0,19,22,26],uppercas:6,upward:17,usag:9,use:[0,2,3,5,6,7,8,9,10,11,12,13,14,15,16,18,21,22,25],used:[0,3,5,9,12,14,16,17,20,21,23,25],useful:[0,17,20],user:18,uses:[2,3,6,7,14],using:[8,12,13,14,16,18,21,26],usual:[0,2,14],util:[0,3,15,19,20],valid:20,valu:[0,1,2,3,7,9,10,13,14,15,16,17,18,20,22,23,25,26],value_n:12,valueerror:[6,20,25],variabl:[20,22],variant:12,variat:[14,17,22],varieti:[5,9],variou:0,vener:25,verbos:5,veri:[0,1,5,6,9,12,16,25],versa:[2,20],version:[0,1,2,6,8,11,18,21,22],via:9,vice:[2,20],view:[12,22],viewer:[1,9,11,24],vii:22,visibl:20,von:[0,2,3,5,14],waaaai:6,wai:[0,2,3,4,5,6,7,9,14,15,16,17,20],wait:17,want:[2,3,7,8,10,12,14,20],warranti:[3,9],wash:9,wast:9,web:25,websit:[0,7],welcom:9,well:[0,4,5,9,10,12,20,23],went:20,were:[9,20,21],what:[2,3,5,6,9,12,14,17,18,20,24],whatev:[2,3,14,18,25],when:[7,8,9,12,14,17,20,21,23,25,26],where:[2,3,4,6,9,12,14,16,20,22,25],whether:[3,14],which:[0,1,3,6,7,9,10,12,14,16,17,18,20,21,23,25,26],whole:[2,3,7,14,18,20],whose:8,why:[10,17,18],wiki:12,wikipedia:[0,12,21],wildli:9,wind:9,wire:14,within:[9,12,15,22],without:[2,9,12,13,16,17,20],won:[12,20,25],word:[0,3,4,7,9,14,21],work:[0,3,4,6,7,8,9,10,12,13,14,16,17,18,21,22,25,26],worker:17,worri:17,worth:7,would:[2,7,8,9,10,12,14,17,20,21,25],wrap:[3,9],wrapper:20,write:[4,5,6,10,12,14,16,17,18,20,21,22,25],written:[0,1,10,12,15,20,25],wrong:2,wrote:20,xrang:20,yang:20,yeah:17,year:[9,20],yet:[12,17,20,21],yield:[2,3,14,20,25],yin:22,you:[0,2,3,6,7,8,9,11,12,13,14,15,16,17,18,20,21,24,25,26],your:[2,3,4,9,14,20],yourself:[6,9,12],zero:[3,6,12,14,17,18,20,23,25],zerodivisionerror:20,zip:[4,6,7,20],zip_:3,zipper:[0,22],zstr:21},titles:["Thun 0.4.1 Documentation","Joy Interpreter","Functions Grouped by, er, Function with Examples","Function Reference","Joy Example Code","Categorical Programming","\u2202RE","Developing a Program in Joy","Using <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> to Generate Values","Thun: Joy in Python","Newton\u2019s method","No Updates","Treating Trees I: Ordered Binary Trees","Quadratic formula","Recursion Combinators","Replacing Functions in the Dictionary","Square Spiral Example Joy Code","The Four Fundamental Operations of Definite Action","Treating Trees II: <code class=\"docutils literal notranslate\"><span class=\"pre\">treestep</span></code>","Type Checking","The Blissful Elegance of Typing Joy","Traversing Datastructures with Zippers","Essays about Programming in Joy","Parsing Text into Joy Expressions","Tracing Joy Execution","Stack or Quote or Sequence or List\u2026","Type Inference of Joy Expressions"],titleterms:{"\u03bb":6,"\u03d5":6,"boolean":16,"case":[10,12],"function":[2,3,6,9,10,12,14,15,17,18,20],"long":15,"new":12,"p\u00f6ial":20,"try":6,"void":2,"while":[2,17],Adding:12,Not:16,One:[8,12],The:[7,9,12,14,16,17,18,20],There:9,Using:8,With:[6,18],about:22,action:17,add:[2,12],adding:12,address:21,alphabet:6,altern:18,ana:14,analysi:7,anamorph:[2,14],app1:2,app2:2,app3:2,appendix:[12,14,20],appli:17,approxim:10,argument:20,auto:3,averag:2,base:[10,12],binari:[2,12,18],bliss:20,both:12,branch:[2,12,16,17],brzozowski:6,can:12,cata:14,catamorph:14,categor:5,challeng:4,chatter:2,check:19,child:12,choic:2,clear:2,cleav:[2,17],cmp:12,code:[0,4,9,12,16],combin:[2,12,14,20],comment:20,compact:6,compar:12,comparison:2,compil:[8,20],compile_:20,compos:20,comput:10,con:[2,20],concat:2,conclus:[14,16,20],consecut:10,continu:9,current:12,datastructur:[6,9,12,21],deal:20,decrement:16,defin:[12,18],definit:[13,17],delabel:20,delet:12,deriv:[6,13,14,18],design:14,determin:21,develop:7,diagram:6,dialect:0,dictionari:15,dip:[2,21],dipd:2,dipdd:2,direco:8,disenstacken:2,distinguish:20,div:2,doc_from_stack_effect:20,document:0,doe:12,down_to_zero:2,drive:6,drop:2,dup:[2,20],dupd:2,dupdip:2,effect:20,eleg:20,els:12,empti:12,enstacken:2,equal:12,essai:22,euler:[7,8],eval:9,even:8,exampl:[0,2,4,9,12,14,16,18,19],execut:24,explor:6,express:[6,9,23,26],extract:18,factori:14,fail:19,fibonacci:8,filter:7,find:[10,12,14],finish:17,finit:6,first:[2,7,16,17,20],five:8,flatten:2,flexibl:18,floordiv:2,form:16,formula:13,found:12,four:[14,17],fsm:6,ftw:4,fulmin:17,fun:14,fundament:17,further:7,gcd:2,gener:[3,6,7,8,10,16],genrec:2,get:[12,18],getitem:2,given:18,greater:12,group:2,handl:17,have:[12,18],help:2,highest:12,host:0,how:[7,8],hybrid:20,hylo:14,hylomorph:14,identifi:20,ift:[2,17],iii:20,implement:[6,20],increment:16,indic:0,infer:[20,26],inferenc:20,inform:0,infra:[2,21],integ:7,interest:8,interlud:12,intern:23,interpret:[1,9,20],item:21,iter:[7,12],joi:[0,1,3,4,7,9,14,16,20,21,22,23,24,25,26],join:17,just:7,kei:12,kind:17,languag:0,larger:6,least_fract:2,left:12,less:12,let:[6,7],letter:6,librari:[3,9,20],like:12,list:[2,25],literari:9,littl:7,logic:[2,20],loop:[2,9,17],lower:12,lshift:2,machin:6,make:[8,10],mani:7,map:[2,17],match:6,math:2,memoiz:6,method:10,min:2,miscellan:2,mod:2,modifi:20,modulu:2,more:12,most:12,mul:[2,20],multipl:[7,8,20],must:12,name:13,neg:[2,16],newton:10,next:[4,10],node:12,non:12,now:12,nullari:2,nulli:6,number:[14,20],one:9,onli:9,oper:17,order:[12,18],origin:16,osdn:0,other:17,our:12,out:6,over:2,pack:7,pam:[2,17],para:14,paradigm:20,parallel:17,parameter:[12,18],pars:[2,23],parser:[9,23],part:[4,20],pass:9,path:21,pattern:14,per:12,piec:16,pop:[2,20],popd:2,popop:2,pow:2,power:8,pred:2,predic:[7,10,12,16,18],pretty_print:24,primit:14,primrec:2,print:9,problem:[7,8],process:12,product:2,program:[5,7,13,18,22],progress:20,project:[0,7,8],pure:9,put:[12,13,16,18],python:[9,15,20],quadrat:13,quick:0,quot:[2,25],rang:[2,7,14],range_to_zero:2,read:9,recur:[10,12],recurs:[12,14,18],redefin:[12,18],refactor:[4,7,12],refer:3,regular:[6,9],reimplement:18,relabel:20,rem:2,remaind:2,remov:2,render:7,repl:9,replac:[12,15],repres:[6,20],represent:6,reset:8,rest:[2,20],revers:[2,6,19],right:[12,21],rightmost:12,roll:[2,20],rolldown:2,rollup:2,rshift:2,rule:[6,20],run:[2,8],second:[2,20],select:2,sequenc:[8,17,20,25],set:[10,12],shorter:15,should:9,shunt:2,simpl:20,simplest:7,size:[2,15],sourc:12,special:[14,20],spiral:16,sqr:[2,20],sqrt:[2,13],squar:16,stack:[2,9,20,25],start:0,state:6,step:[2,14,18],straightforward:13,stream:6,string:6,structur:12,style:9,sub:[2,12],subtyp:20,succ:2,sum:[2,7],swaack:2,swap:[2,20],swon:2,swoncat:2,symbol:[9,14],tabl:0,tail:14,take:2,term:[7,8,18],ternari:2,text:23,than:12,them:13,thi:12,third:[2,20],three:8,thun:[0,9],time:[2,8],togeth:[12,13,16,18],token:9,toler:10,trace:[15,24],traceprint:9,trampolin:6,translat:16,travers:[12,18,21],treat:[12,18],tree:[12,18,21],treegrind:18,treestep:18,triangular:14,truediv:2,truthi:2,tuck:2,turn:16,two:[6,8],type:[19,20,26],unari:2,unbound:20,uncon:[2,20],unif:19,unifi:20,unit:2,unnecessari:7,unquot:2,unstack:2,updat:[11,20],use:20,util:[24,25,26],valu:[8,12],variabl:13,variat:8,version:[7,12,15,20],view:9,vii:20,within:10,word:2,work:[19,20],write:13,xor:2,yin:20,zero:8,zip:2,zipper:21}}) | |
\ No newline at end of file |
@@ -0,0 +1,281 @@ | ||
1 | +Joy Example Code | |
2 | +================ | |
3 | + | |
4 | +A brief example of Joy programming from the `Advent of Code 2017, | |
5 | +December 1st puzzle <https://adventofcode.com/2017/day/1>`__. | |
6 | + | |
7 | + Given a sequence of digits (your puzzle input) and find the sum of | |
8 | + all digits that match the next digit in the list. The list is | |
9 | + circular, so the digit after the last digit is the first digit in | |
10 | + the list. | |
11 | + | |
12 | +For example: | |
13 | + | |
14 | +- 1122 produces a sum of 3 (1 + 2) because the first digit (1) matches | |
15 | + the second digit and the third digit (2) matches the fourth digit. | |
16 | +- 1111 produces 4 because each digit (all 1) matches the next. | |
17 | +- 1234 produces 0 because no digit matches the next. | |
18 | +- 91212129 produces 9 because the only digit that matches the next one | |
19 | + is the last digit, 9. | |
20 | + | |
21 | +.. code:: ipython3 | |
22 | + | |
23 | + from notebook_preamble import J, V, define | |
24 | + | |
25 | +I'll assume the input is a Joy sequence of integers (as opposed to a | |
26 | +string or something else.) | |
27 | + | |
28 | +We might proceed by creating a word that makes a copy of the sequence | |
29 | +with the first item moved to the last, and zips it with the original to | |
30 | +make a list of pairs, and a another word that adds (one of) each pair to | |
31 | +a total if the pair matches. | |
32 | + | |
33 | +:: | |
34 | + | |
35 | + AoC2017.1 == pair_up total_matches | |
36 | + | |
37 | +Let's derive ``pair_up``: | |
38 | + | |
39 | +:: | |
40 | + | |
41 | + [a b c] pair_up | |
42 | + ------------------------- | |
43 | + [[a b] [b c] [c a]] | |
44 | + | |
45 | +Straightforward (although the order of each pair is reversed, due to the | |
46 | +way ``zip`` works, but it doesn't matter for this program): | |
47 | + | |
48 | +:: | |
49 | + | |
50 | + [a b c] dup | |
51 | + [a b c] [a b c] uncons swap | |
52 | + [a b c] [b c] a unit concat | |
53 | + [a b c] [b c a] zip | |
54 | + [[b a] [c b] [a c]] | |
55 | + | |
56 | +.. code:: ipython3 | |
57 | + | |
58 | + define('pair_up dup uncons swap unit concat zip') | |
59 | + | |
60 | +.. code:: ipython3 | |
61 | + | |
62 | + J('[1 2 3] pair_up') | |
63 | + | |
64 | + | |
65 | +.. parsed-literal:: | |
66 | + | |
67 | + [[2 1] [3 2] [1 3]] | |
68 | + | |
69 | + | |
70 | +.. code:: ipython3 | |
71 | + | |
72 | + J('[1 2 2 3] pair_up') | |
73 | + | |
74 | + | |
75 | +.. parsed-literal:: | |
76 | + | |
77 | + [[2 1] [2 2] [3 2] [1 3]] | |
78 | + | |
79 | + | |
80 | +Now we need to derive ``total_matches``. It will be a ``step`` function: | |
81 | + | |
82 | +:: | |
83 | + | |
84 | + total_matches == 0 swap [F] step | |
85 | + | |
86 | +Where ``F`` will have the pair to work with, and it will basically be a | |
87 | +``branch`` or ``ifte``. | |
88 | + | |
89 | +:: | |
90 | + | |
91 | + total [n m] F | |
92 | + | |
93 | +It will probably be easier to write if we dequote the pair: | |
94 | + | |
95 | +:: | |
96 | + | |
97 | + total [n m] i F′ | |
98 | + ---------------------- | |
99 | + total n m F′ | |
100 | + | |
101 | +Now ``F′`` becomes just: | |
102 | + | |
103 | +:: | |
104 | + | |
105 | + total n m [=] [pop +] [popop] ifte | |
106 | + | |
107 | +So: | |
108 | + | |
109 | +:: | |
110 | + | |
111 | + F == i [=] [pop +] [popop] ifte | |
112 | + | |
113 | +And thus: | |
114 | + | |
115 | +:: | |
116 | + | |
117 | + total_matches == 0 swap [i [=] [pop +] [popop] ifte] step | |
118 | + | |
119 | +.. code:: ipython3 | |
120 | + | |
121 | + define('total_matches 0 swap [i [=] [pop +] [popop] ifte] step') | |
122 | + | |
123 | +.. code:: ipython3 | |
124 | + | |
125 | + J('[1 2 3] pair_up total_matches') | |
126 | + | |
127 | + | |
128 | +.. parsed-literal:: | |
129 | + | |
130 | + 0 | |
131 | + | |
132 | + | |
133 | +.. code:: ipython3 | |
134 | + | |
135 | + J('[1 2 2 3] pair_up total_matches') | |
136 | + | |
137 | + | |
138 | +.. parsed-literal:: | |
139 | + | |
140 | + 2 | |
141 | + | |
142 | + | |
143 | +Now we can define our main program and evaluate it on the examples. | |
144 | + | |
145 | +.. code:: ipython3 | |
146 | + | |
147 | + define('AoC2017.1 pair_up total_matches') | |
148 | + | |
149 | +.. code:: ipython3 | |
150 | + | |
151 | + J('[1 1 2 2] AoC2017.1') | |
152 | + | |
153 | + | |
154 | +.. parsed-literal:: | |
155 | + | |
156 | + 3 | |
157 | + | |
158 | + | |
159 | +.. code:: ipython3 | |
160 | + | |
161 | + J('[1 1 1 1] AoC2017.1') | |
162 | + | |
163 | + | |
164 | +.. parsed-literal:: | |
165 | + | |
166 | + 4 | |
167 | + | |
168 | + | |
169 | +.. code:: ipython3 | |
170 | + | |
171 | + J('[1 2 3 4] AoC2017.1') | |
172 | + | |
173 | + | |
174 | +.. parsed-literal:: | |
175 | + | |
176 | + 0 | |
177 | + | |
178 | + | |
179 | +.. code:: ipython3 | |
180 | + | |
181 | + J('[9 1 2 1 2 1 2 9] AoC2017.1') | |
182 | + | |
183 | + | |
184 | +.. parsed-literal:: | |
185 | + | |
186 | + 9 | |
187 | + | |
188 | + | |
189 | +:: | |
190 | + | |
191 | + pair_up == dup uncons swap unit concat zip | |
192 | + total_matches == 0 swap [i [=] [pop +] [popop] ifte] step | |
193 | + | |
194 | + AoC2017.1 == pair_up total_matches | |
195 | + | |
196 | +Next Part of the Challenge | |
197 | +-------------------------- | |
198 | + | |
199 | +Now the paired digit is "halfway" round. | |
200 | + | |
201 | +:: | |
202 | + | |
203 | + [a b c d] dup size 2 / [drop] [take reverse] cleave concat zip | |
204 | + | |
205 | +.. code:: ipython3 | |
206 | + | |
207 | + J('[1 2 3 4] dup size 2 / [drop] [take reverse] cleave concat zip') | |
208 | + | |
209 | + | |
210 | +.. parsed-literal:: | |
211 | + | |
212 | + [[3 1] [4 2] [1 3] [2 4]] | |
213 | + | |
214 | + | |
215 | +I realized that each pair is repeated... | |
216 | + | |
217 | +.. code:: ipython3 | |
218 | + | |
219 | + J('[1 2 3 4] dup size 2 / [drop] [take reverse] cleave zip') | |
220 | + | |
221 | + | |
222 | +.. parsed-literal:: | |
223 | + | |
224 | + [1 2 3 4] [[1 3] [2 4]] | |
225 | + | |
226 | + | |
227 | +.. code:: ipython3 | |
228 | + | |
229 | + define('AoC2017.1.extra dup size 2 / [drop] [take reverse] cleave zip swap pop total_matches 2 *') | |
230 | + | |
231 | +.. code:: ipython3 | |
232 | + | |
233 | + J('[1 2 1 2] AoC2017.1.extra') | |
234 | + | |
235 | + | |
236 | +.. parsed-literal:: | |
237 | + | |
238 | + 6 | |
239 | + | |
240 | + | |
241 | +.. code:: ipython3 | |
242 | + | |
243 | + J('[1 2 2 1] AoC2017.1.extra') | |
244 | + | |
245 | + | |
246 | +.. parsed-literal:: | |
247 | + | |
248 | + 0 | |
249 | + | |
250 | + | |
251 | +.. code:: ipython3 | |
252 | + | |
253 | + J('[1 2 3 4 2 5] AoC2017.1.extra') | |
254 | + | |
255 | + | |
256 | +.. parsed-literal:: | |
257 | + | |
258 | + 4 | |
259 | + | |
260 | + | |
261 | +Refactor FTW | |
262 | +============ | |
263 | + | |
264 | +With Joy a great deal of the heuristics from Forth programming carry | |
265 | +over nicely. For example, refactoring into small, well-scoped commands | |
266 | +with mnemonic names... | |
267 | + | |
268 | +:: | |
269 | + | |
270 | + rotate_seq == uncons swap unit concat | |
271 | + pair_up == dup rotate_seq zip | |
272 | + add_if_match == [=] [pop +] [popop] ifte | |
273 | + total_matches == [i add_if_match] step_zero | |
274 | + | |
275 | + AoC2017.1 == pair_up total_matches | |
276 | + | |
277 | + half_of_size == dup size 2 / | |
278 | + split_at == [drop] [take reverse] cleave | |
279 | + pair_up.extra == half_of_size split_at zip swap pop | |
280 | + | |
281 | + AoC2017.1.extra == pair_up.extra total_matches 2 * |
@@ -11,6 +11,7 @@ | ||
11 | 11 | Developing |
12 | 12 | Quadratic |
13 | 13 | Replacing |
14 | + Advent_of_Code_2017_December_1st | |
14 | 15 | Recursion_Combinators |
15 | 16 | Ordered_Binary_Trees |
16 | 17 | Treestep |