diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-06 22:14:00 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-06 22:14:00 -0400 |
| commit | 97e31a20cefe21c1627f33057d20d7970511754f (patch) | |
| tree | 5af5284ea6f018f3eaed2f61dc1e832efa8ebfec | |
| parent | 632fdd3c713da19ae6e8e7b93078c838bcc06d9f (diff) | |
Diagram for Take and Drop
| -rw-r--r-- | doc/take.md | 43 | ||||
| -rw-r--r-- | docs/doc/take.html | 35 |
2 files changed, 78 insertions, 0 deletions
diff --git a/doc/take.md b/doc/take.md new file mode 100644 index 00000000..1cc0b833 --- /dev/null +++ b/doc/take.md @@ -0,0 +1,43 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/doc/take.html).* + +# Take and Drop + +<!--GEN +xt ← '''(Highlight∾∾⊣)¨ "startend" +wv ← 5 +d ← 56‿80 + +rc ← At "class=code|stroke-width=1.5|rx=12" +Ge ← "g"⊸At⊸Enc +g ← "fill=currentColor|stroke-linecap=round|text-anchor=middle|font-family=BQN,monospace" +cg ← "font-size=25px" +bg ← "class=bluegreen|stroke-width=3|style=fill:none|opacity=0.8" +ag ← "class=green|stroke-width=3|style=fill:none|opacity=0.8" +lg ← "class=red|stroke-width=2.5|stroke-dasharray=9 9|opacity=0.9" + +Text ← ("text" Attr "dy"‿"0.32em"∾ ·Pos d⊸×)⊸Enc +Line ← "line" Elt ("xy"≍⌜"12")≍˘○⥊ ·FmtNum d×⊢ + +_brak ← { + P ← ∾"M l l "∾¨ ·FmtNum∘⥊ ∾ + "path" Elt "d"≍○< ∾ (𝕨((0‿¯1×𝕗)+d×≍)⌜𝕩) P¨ ≍○<⟜⌽ -⌾⊑⊸≍𝕗 +} +ab ← ¯25‿12 + +tx ← ↕≠xt ⋄ ay ← 0.54 + ty ← 0 +wm ← 0‿1 ⊑ bp ← 2↕(÷2)-˜⟨0,wv,≠xt⟩ +tp ← (¯1.2∾2÷˜+˝bp) ≍¨ ty+/1‿2 +dim ← ⟨2+≠tx,1.96⟩ ⋄ sh ← ¯1.8‿¯0.5 + +((∾˜d)×((-∾+˜)1‿0.3)+sh∾dim) SVG g Ge ⟨ + "rect" Elt rc ∾ (Pos d×sh)∾"width"‿"height"≍˘FmtNum d×dim + cg Ge tp Text⟜Highlight¨ (<∾"↑"‿"↓"((•Repr wv)∾∾)¨<) "𝕩" + "font-size=21px" Ge (tx≍¨ty) Text¨ xt + bg Ge ((-⊸≍0.4)+0‿¯1⊏tx) 6‿15 _brak ty + ag Ge ⟨ + ((-⊸≍0.9)+wm) ab _brak ay + Line∘≍⟜(≍˜ay)¨ <˘ bp + -∘⌽⊸≍⟨0.9+ab÷○⊑d,¯0.2⟩ + ⟩ + lg Ge Line wm ≍˜⊸≍ ¯0.3‿1.2+ty +⟩ +--> diff --git a/docs/doc/take.html b/docs/doc/take.html new file mode 100644 index 00000000..78ffafeb --- /dev/null +++ b/docs/doc/take.html @@ -0,0 +1,35 @@ +<head> + <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/> + <link href="../style.css" rel="stylesheet"/> + <title>BQN: Take and Drop</title> +</head> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> +<h1 id="take-and-drop">Take and Drop</h1> +<svg viewBox='-156.8 -64 672 204.8'> + <g fill='currentColor' stroke-linecap='round' text-anchor='middle' font-family='BQN,monospace'> + <rect class='code' stroke-width='1.5' rx='12' x='-100.8' y='-40' width='560' height='156.8'/> + <g font-size='25px'> + <text dy='0.32em' x='-67.2' y='0'><tspan class='Value'>𝕩</tspan></text> + <text dy='0.32em' x='112' y='80'><tspan class='Number'>5</tspan><tspan class='Function'>↑</tspan><tspan class='Value'>𝕩</tspan></text> + <text dy='0.32em' x='336' y='80'><tspan class='Number'>5</tspan><tspan class='Function'>↓</tspan><tspan class='Value'>𝕩</tspan></text> + </g> + <g font-size='21px'> + <text dy='0.32em' x='0' y='0'><tspan class='String'>'s'</tspan></text> + <text dy='0.32em' x='56' y='0'><tspan class='String'>'t'</tspan></text> + <text dy='0.32em' x='112' y='0'><tspan class='String'>'a'</tspan></text> + <text dy='0.32em' x='168' y='0'><tspan class='String'>'r'</tspan></text> + <text dy='0.32em' x='224' y='0'><tspan class='String'>'t'</tspan></text> + <text dy='0.32em' x='280' y='0'><tspan class='String'>'e'</tspan></text> + <text dy='0.32em' x='336' y='0'><tspan class='String'>'n'</tspan></text> + <text dy='0.32em' x='392' y='0'><tspan class='String'>'d'</tspan></text> + </g> + <g class='bluegreen' stroke-width='3' style='fill:none' opacity='0.8'><path d='M-22.4 -15l-6 15l6 15M414.4 -15l6 15l-6 15'/></g> + <g class='green' stroke-width='3' style='fill:none' opacity='0.8'> + <path d='M201.6 31.2l25 12l-25 12M302.4 31.2l-25 12l25 12'/> + <line x1='-16.8' x2='226.6' y1='43.2' y2='43.2'/> + <line x1='277.4' x2='408.8' y1='43.2' y2='43.2'/> + </g> + <g class='red' stroke-width='2.5' stroke-dasharray='9 9' opacity='0.9'><line x1='252' x2='252' y1='-24' y2='96'/></g> + </g> +</svg> + |
