changeset ab34fee54595 in joypy/Joypy details: http://hg.osdn.jp/view/joypy/Joypy?cmd=changeset;node=ab34fee54595 user: Simon Forman <sform****@hushm*****> date: Wed Jun 03 07:52:21 2020 -0700 description: Added a page to the docs. Advent_of_Code_2017_December_1st a simple example. diffstat: docs/Advent_of_Code_2017_December_1st.html | 101 +-- docs/Advent_of_Code_2017_December_1st.ipynb | 59 +- docs/Advent_of_Code_2017_December_1st.md | 27 +- docs/Advent_of_Code_2017_December_1st.rst | 71 +- docs/Makefile | 2 +- docs/sphinx_docs/_build/html/index.html | 2 + docs/sphinx_docs/_build/html/notebooks/Derivatives_of_Regular_Expressions.html | 2 + docs/sphinx_docs/_build/html/notebooks/Generator_Programs.html | 2 + docs/sphinx_docs/_build/html/notebooks/Newton-Raphson.html | 2 + docs/sphinx_docs/_build/html/notebooks/Ordered_Binary_Trees.html | 2 + docs/sphinx_docs/_build/html/notebooks/Quadratic.html | 2 + docs/sphinx_docs/_build/html/notebooks/Recursion_Combinators.html | 6 +- docs/sphinx_docs/_build/html/notebooks/Replacing.html | 6 +- docs/sphinx_docs/_build/html/notebooks/The_Four_Operations.html | 2 + docs/sphinx_docs/_build/html/notebooks/Treestep.html | 2 + docs/sphinx_docs/_build/html/notebooks/TypeChecking.html | 2 + docs/sphinx_docs/_build/html/notebooks/Types.html | 2 + docs/sphinx_docs/_build/html/notebooks/Zipper.html | 2 + docs/sphinx_docs/_build/html/notebooks/index.html | 7 + docs/sphinx_docs/_build/html/objects.inv | Bin docs/sphinx_docs/_build/html/searchindex.js | 2 +- docs/sphinx_docs/notebooks/Advent_of_Code_2017_December_1st.rst | 281 ++++++++++ docs/sphinx_docs/notebooks/index.rst | 1 + 23 files changed, 414 insertions(+), 171 deletions(-) diffs (truncated from 1220 to 300 lines): diff -r 33cf8e5aec62 -r ab34fee54595 docs/Advent_of_Code_2017_December_1st.html --- a/docs/Advent_of_Code_2017_December_1st.html Sat May 30 23:39:16 2020 -0700 +++ b/docs/Advent_of_Code_2017_December_1st.html Wed Jun 03 07:52:21 2020 -0700 @@ -13077,7 +13077,9 @@ <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> </div><div class="inner_cell"> <div class="text_cell_render border-box-sizing rendered_html"> -<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> +<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> +<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> +</blockquote> <p>For example:</p> <ul> <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 @@ <div class="prompt input_prompt">In [1]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13139,7 +13141,7 @@ <div class="prompt input_prompt">In [2]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13152,7 +13154,7 @@ <div class="prompt input_prompt">In [3]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13183,7 +13185,7 @@ <div class="prompt input_prompt">In [4]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13251,7 +13253,7 @@ <div class="prompt input_prompt">In [5]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13264,7 +13266,7 @@ <div class="prompt input_prompt">In [6]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13295,7 +13297,7 @@ <div class="prompt input_prompt">In [7]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13334,7 +13336,7 @@ <div class="prompt input_prompt">In [8]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13347,7 +13349,7 @@ <div class="prompt input_prompt">In [9]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13378,7 +13380,7 @@ <div class="prompt input_prompt">In [10]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13409,7 +13411,7 @@ <div class="prompt input_prompt">In [11]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13440,38 +13442,7 @@ <div class="prompt input_prompt">In [12]:</div> <div class="inner_cell"> <div class="input_area"> -<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> -</pre></div> - - </div> -</div> -</div> - -<div class="output_wrapper"> -<div class="output"> - - -<div class="output_area"> - - <div class="prompt"></div> - - -<div class="output_subarea output_stream output_stdout output_text"> -<pre>9 -</pre> -</div> -</div> - -</div> -</div> - -</div> -<div class="cell border-box-sizing code_cell rendered"> -<div class="input"> -<div class="prompt input_prompt">In [13]:</div> -<div class="inner_cell"> - <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13509,18 +13480,12 @@ </div> </div> </div> -<div class="cell border-box-sizing code_cell rendered"> -<div class="input"> -<div class="prompt input_prompt">In [ ]:</div> -<div class="inner_cell"> - <div class="input_area"> -<div class=" highlight hl-ipython2"><pre><span></span> -</pre></div> - - </div> -</div> -</div> - +<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> +</div><div class="inner_cell"> +<div class="text_cell_render border-box-sizing rendered_html"> +<h2 id="Next-Part-of-the-Challenge">Next Part of the Challenge<a class="anchor-link" href="#Next-Part-of-the-Challenge">¶</a></h2> +</div> +</div> </div> <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> </div><div class="inner_cell"> @@ -13534,10 +13499,10 @@ </div> <div class="cell border-box-sizing code_cell rendered"> <div class="input"> -<div class="prompt input_prompt">In [14]:</div> +<div class="prompt input_prompt">In [13]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13573,10 +13538,10 @@ </div> <div class="cell border-box-sizing code_cell rendered"> <div class="input"> -<div class="prompt input_prompt">In [15]:</div> +<div class="prompt input_prompt">In [14]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13604,10 +13569,10 @@ </div> <div class="cell border-box-sizing code_cell rendered"> <div class="input"> -<div class="prompt input_prompt">In [16]:</div> +<div class="prompt input_prompt">In [15]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13617,10 +13582,10 @@ </div> <div class="cell border-box-sizing code_cell rendered"> <div class="input"> -<div class="prompt input_prompt">In [17]:</div> +<div class="prompt input_prompt">In [16]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13648,10 +13613,10 @@ </div> <div class="cell border-box-sizing code_cell rendered"> <div class="input"> -<div class="prompt input_prompt">In [18]:</div> +<div class="prompt input_prompt">In [17]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> @@ -13679,10 +13644,10 @@ </div> <div class="cell border-box-sizing code_cell rendered"> <div class="input"> -<div class="prompt input_prompt">In [19]:</div> +<div class="prompt input_prompt">In [18]:</div> <div class="inner_cell"> <div class="input_area"> -<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> +<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> </pre></div> </div> diff -r 33cf8e5aec62 -r ab34fee54595 docs/Advent_of_Code_2017_December_1st.ipynb --- a/docs/Advent_of_Code_2017_December_1st.ipynb Sat May 30 23:39:16 2020 -0700 +++ b/docs/Advent_of_Code_2017_December_1st.ipynb Wed Jun 03 07:52:21 2020 -0700 @@ -4,11 +4,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Advent of Code 2017\n", + "# Joy Example Code\n", "\n", - "## December 1st\n", + "A brief example of Joy programming from the [Advent of Code 2017, December 1st puzzle](https://adventofcode.com/2017/day/1).\n", "\n", - "\\[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", + "> 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", "\n", "For example:\n", "\n", @@ -63,7 +63,7 @@ "metadata": {}, "outputs": [], "source": [ - "define('pair_up == dup uncons swap unit concat zip')" + "define('pair_up dup uncons swap unit concat zip')" ] }, { @@ -139,7 +139,7 @@ "metadata": {}, "outputs": [], "source": [ - "define('total_matches == 0 swap [i [=] [pop +] [popop] ifte] step')" + "define('total_matches 0 swap [i [=] [pop +] [popop] ifte] step')" ] }, { @@ -189,7 +189,7 @@ "metadata": {}, "outputs": [], "source": [ - "define('AoC2017.1 == pair_up total_matches')" + "define('AoC2017.1 pair_up total_matches')" ] },