diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-11-01 14:37:51 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-11-01 14:37:51 -0500 |
| commit | 485f9b1af138d914bf46160ab87a021b900441d7 (patch) | |
| tree | 178440bf698f32fcc00f15079854ed02c9f23f10 /docs/tutorial/list.html | |
| parent | 52654b396d5af7c0745aba8818b051440ef6529f (diff) | |
Add expression diagram for one part of base decoding
Diffstat (limited to 'docs/tutorial/list.html')
| -rw-r--r-- | docs/tutorial/list.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/docs/tutorial/list.html b/docs/tutorial/list.html index 13760cbf..9a50669a 100644 --- a/docs/tutorial/list.html +++ b/docs/tutorial/list.html @@ -278,6 +278,53 @@ 9 </pre> <p>Lot of functions up there. Notice how I need to use parentheses for the left argument of a function if it's compound, but never for the right argument, and consequently never with a one-argument function.</p> +<svg viewBox='-132.375 -34 512 210'> + <g font-family='BQN,monospace' font-size='18px'> + <rect class='code' stroke-width='1' rx='10' x='-21.5' y='-24' width='290.25' height='190'/> + <text><tspan class='Function'>+</tspan><tspan class='Modifier'>´</tspan> <tspan class='Paren'>(</tspan><tspan class='Function'>⌽</tspan><tspan class='Number'>2</tspan><tspan class='Function'>⋆</tspan><tspan class='Function'>↕</tspan><tspan class='Number'>4</tspan><tspan class='Paren'>)</tspan> <tspan class='Function'>×</tspan> <tspan class='String'>"1001"</tspan><tspan class='Function'>-</tspan><tspan class='String'>'0'</tspan></text> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M232.2 1.9V20.9H210.7'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M173.075 1.9V20.9H210.7'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M210.7 20.9V96.9H124.7'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M92.45 1.9V39.9H81.7'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M81.7 39.9V58.9H70.95'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M60.2 1.9V58.9H70.95'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M70.95 58.9V77.9H49.45'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M49.45 77.9V96.9H124.7'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M124.7 96.9V134.9H17.2'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M6.45 1.9V115.9H17.2'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M17.2 115.9V134.9H17.2'/> + <path class='Paren' stroke='currentColor' fill='none' stroke-width='1' d='M17.2 134.9V153.9H-6.987'/> + <g font-size='15px' text-anchor='middle'> + <g class='codeCover' stroke-width='8' stroke-linejoin='round'> + <text x='232.125' y='28'>'0'</text> + <text x='210.625' y='28'>-</text> + <text x='173' y='28'>"1001"</text> + <text x='124.625' y='104'>×</text> + <text x='92.375' y='47'>4</text> + <text x='81.625' y='47'>↕</text> + <text x='70.875' y='66'>⋆</text> + <text x='60.125' y='66'>2</text> + <text x='49.375' y='85'>⌽</text> + <text x='17.125' y='123'>´</text> + <text x='6.375' y='123'>+</text> + </g> + <g opacity='0.9'> + <text x='232.125' y='26'><tspan class='String'>'0'</tspan></text> + <text x='210.625' y='26'><tspan class='Function'>-</tspan></text> + <text x='173' y='26'><tspan class='String'>"1001"</tspan></text> + <text x='124.625' y='102'><tspan class='Function'>×</tspan></text> + <text x='92.375' y='45'><tspan class='Number'>4</tspan></text> + <text x='81.625' y='45'><tspan class='Function'>↕</tspan></text> + <text x='70.875' y='64'><tspan class='Function'>⋆</tspan></text> + <text x='60.125' y='64'><tspan class='Number'>2</tspan></text> + <text x='49.375' y='83'><tspan class='Function'>⌽</tspan></text> + <text x='17.125' y='121'><tspan class='Modifier'>´</tspan></text> + <text x='6.375' y='121'><tspan class='Function'>+</tspan></text> + </g> + </g> + </g> +</svg> + <p>Representing our ASCII statement as a list of lists, we convert each digit to a number as before:</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=JzAnIC3LnCAiMDEwMDExMTAi4oC/IjAxMTAwMTAxIuKAvyIwMTExMDAxMCLigL8iMDExMDAxMDAi4oC/IjAwMTAwMDAxIg==">↗️</a><pre> <span class='String'>'0'</span> <span class='Function'>-</span><span class='Modifier'>˜</span> <span class='String'>"01001110"</span><span class='Ligature'>‿</span><span class='String'>"01100101"</span><span class='Ligature'>‿</span><span class='String'>"01110010"</span><span class='Ligature'>‿</span><span class='String'>"01100100"</span><span class='Ligature'>‿</span><span class='String'>"00100001"</span> ⟨ ⟨ 0 1 0 0 1 1 1 0 ⟩ ⟨ 0 1 1 0 0 1 0 1 ⟩ ⟨ 0 1 1 1 0 0 1 0 ⟩ ⟨ 0 1 1 0 0 1 0 0 ⟩ ⟨ 0 0 1 0 0 0 0 1 ⟩ ⟩ |
