diff options
| -rw-r--r-- | community/aoc.md | 41 | ||||
| -rw-r--r-- | docs/community/aoc.html | 89 |
2 files changed, 121 insertions, 9 deletions
diff --git a/community/aoc.md b/community/aoc.md index b636668d..930040fb 100644 --- a/community/aoc.md +++ b/community/aoc.md @@ -31,6 +31,36 @@ </center> +<!--GEN +nam ← ⟨"Raghu","dzaima","Hannu","frasiyav","Leah","Antti","Caleb","Alex","Andrey","Johnny","Ben","Alvin","Josh","Alastair","Olodus","Aren","Dimitri","Alexander","Mathias","m-lima","Dunya","Benjamin"⟩ +sol ← ⟨1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿12‿13‿14‿15‿16‿17‿18‿19‿20‿21‿22‿23‿24‿25,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿12‿13‿14‿15‿16‿17‿18‿19‿20‿21‿22‿23‿24‿25,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿12‿13‿14‿15‿16‿17‿18‿19‿20‿21‿22‿24‿25,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿12‿13‿14‿15‿16‿17‿18‿19‿20‿21‿22,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿13‿14‿15‿17‿18‿20‿21‿24‿25,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿12‿13‿14‿15‿16‿17‿18‿20‿21,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿12‿13‿14‿15,1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿13‿14,1‿2‿3‿5‿6‿7‿11‿12‿13‿15‿17‿20,1‿2‿3‿4‿5‿6‿7‿9‿10,1‿2‿3‿4‿5‿6‿7,1‿2‿3‿4‿5‿6‿7,1‿2‿3‿4‿5‿6‿7,1‿3‿6‿7‿9,1‿2‿3‿9,6‿7‿9,1‿3,⟨3⟩,⟨3⟩,⟨1⟩,⟨1⟩,⟨1⟩⟩ + +Ge ← "g"⊸At⊸Enc + +w ← (w0←90) + (tw←20) × 0.4+m←25 +h ← (h0←56) + (th←18) × n←≠nam +wh ← w‿h +out← 40‿10 + +pa ← "class=Paren|stroke=currentColor|fill=none" +rc ← At "class=code|stroke-width=1|rx=6" +gt ← "stroke-width=1|font-size=14px|fill=currentColor" +Path ← "path" Elt "d"⊸⋈⊘(⊣∾"d"⋈⊢) + +bar ← (/¯∞⊸»<-⟜1)⊸(⊏⋈¨«˜⟜≠-⊣)¨ sol-1 + +((-out÷2)∾wh+out) SVG gt Ge ∾⥊¨ ⟨ + <"rect" Elt rc∾(Pos 0‿0)∾"width"‿"height"≍˘FmtNum wh + pa Ge Path¨ <∘∾˘("M "⊸∾˘"VH")∾¨FmtNum ((=⌜˜↕2)×w0‿(h0-6))∾˘⌽wh + "text-anchor=middle" Ge ⟨ + ("text" Attr "font-size"‿"20px"∾Pos⟨w0+tw×m÷2,h0-32⟩) Enc "Day" + "font-size=11px" Ge ((w0+tw×0.5+↕m)Pos∘⋈¨h0-10) "text"⊸Attr⊸Enc¨ FmtNum 1+↕25 + ⟩ + (10 Pos∘⋈¨h0+th×0.5+↕n) "text"⊸Attr⊸Enc¨ nam + "stroke-width=6|class=green" Ge Path¨ (∾("M h"⥊˜≠)∾¨FmtNum)¨ (h0+th×0.25+↕n) (∾((w0+⊑∘⊢)∾⊣∾1⊑⊢)¨)¨ tw×bar +⟩ +--> + In addition to these, Leah wrote two blog posts explaining her solutions for [day 6](https://leahneukirchen.org/blog/archive/2021/12/counting-lanternfish-with-bqn-and-linear-algebra.html) and [day 9](https://leahneukirchen.org/blog/archive/2021/12/surveying-lava-basins-with-bqn-and-fixpoints.html). The number of solutions for each of the 25 days is plotted below, along with totals from AoC's [stats page](https://adventofcode.com/2021/stats). The BQN solutions are scaled to be visible here: there are 6839 times more valid AoC submissions than published BQN solutions overall. @@ -43,11 +73,8 @@ width ← 256 pad ← 40‿40 pad1 ← 40‿10+pad -pa ← At "class=Paren|stroke=currentColor" pc ← At "class=red|r=4" -rc ← At "class=code|stroke-width=1|rx=6" -gr ← "g" At "stroke-width=1|font-size=13px|text-anchor=end|fill=currentColor" -Path ← "path" Elt ⊣∾"d"⋈⊢ +gr ← "stroke-width=1|font-size=13px|text-anchor=end|fill=currentColor" col ← "class"⊸⋈¨"red"‿"green" lab ← "Solutions in:"‿"Anything"‿"BQN" @@ -56,14 +83,14 @@ ar ← ÷2 dim ← width (⊣≍×) ar Scale ← ¬⌾(1⊸⊑) ÷⟜win line ← (/≠¨⊏xy) ⊔ FmtNum ⍉> dim×Scale pts -((-pad1÷2)∾dim+pad1) SVG gr Enc ∾⥊¨ ⟨ +((-pad1÷2)∾dim+pad1) SVG gr Ge ∾⥊¨ ⟨ <"rect" Elt rc∾(Pos-pad÷2)∾"width"‿"height"≍˘FmtNum dim+pad ((col∾¨⊢)⌾(1⊸↓)(Pos(⊑dim)⊸⋈)¨18×0.5+↕3) "text"⊸Attr⊸Enc¨ lab - ("g" At "text-anchor=middle|opacity=0.8") Enc "text"⊸Attr⊸Enc˜´¨ ⟨ + "text-anchor=middle|opacity=0.8" Ge "text"⊸Attr⊸Enc˜´¨ ⟨ ⟨"day", "dy"‿"1em"∾Pos dim×0.5‿1⟩ ⟨"count", "transform"‿"rotate(-90)"∾"dy"‿"-0.35em"∾Pos ⌽dim×0‿¯0.5⟩ ⟩ - pa⊸Path¨ ((0⊸≤∧≤⟜1)/·<∘∾˘("M "⊸∾˘"VH")∾¨·FmtNum dim(×∾˘⌽∘⊣)(=⌜˜↕2)⊸×) Scale 0 + <pa At⊸Path ∾("M VH")∾¨FmtNum dim(×∾⌽∘⊣)1‿0×Scale 0 col ≍⟜"style"‿"fill:none"⊸Path⟜('M'⌾⊑∘∾·⥊ "L "∾¨⎉1⊢)¨ line ⟩ --> diff --git a/docs/community/aoc.html b/docs/community/aoc.html index 7c0c717f..6d8d8971 100644 --- a/docs/community/aoc.html +++ b/docs/community/aoc.html @@ -32,6 +32,92 @@ <a href="https://github.com/Camto/Advent-of-Code-2021/tree/master/BQN">Benjamin Applegate</a></p> </center> +<svg viewBox='-20 -5 638 462'> + <g stroke-width='1' font-size='14px' fill='currentColor'> + <rect class='code' stroke-width='1' rx='6' x='0' y='0' width='598' height='452'/> + <g class='Paren' stroke='currentColor' fill='none'> + <path d='M90 0V452'/> + <path d='M0 50H598'/> + </g> + <g text-anchor='middle'> + <text font-size='20px' x='340' y='24'>Day</text> + <g font-size='11px'> + <text x='100' y='46'>1</text> + <text x='120' y='46'>2</text> + <text x='140' y='46'>3</text> + <text x='160' y='46'>4</text> + <text x='180' y='46'>5</text> + <text x='200' y='46'>6</text> + <text x='220' y='46'>7</text> + <text x='240' y='46'>8</text> + <text x='260' y='46'>9</text> + <text x='280' y='46'>10</text> + <text x='300' y='46'>11</text> + <text x='320' y='46'>12</text> + <text x='340' y='46'>13</text> + <text x='360' y='46'>14</text> + <text x='380' y='46'>15</text> + <text x='400' y='46'>16</text> + <text x='420' y='46'>17</text> + <text x='440' y='46'>18</text> + <text x='460' y='46'>19</text> + <text x='480' y='46'>20</text> + <text x='500' y='46'>21</text> + <text x='520' y='46'>22</text> + <text x='540' y='46'>23</text> + <text x='560' y='46'>24</text> + <text x='580' y='46'>25</text> + </g> + </g> + <text x='10' y='65'>Raghu</text> + <text x='10' y='83'>dzaima</text> + <text x='10' y='101'>Hannu</text> + <text x='10' y='119'>frasiyav</text> + <text x='10' y='137'>Leah</text> + <text x='10' y='155'>Antti</text> + <text x='10' y='173'>Caleb</text> + <text x='10' y='191'>Alex</text> + <text x='10' y='209'>Andrey</text> + <text x='10' y='227'>Johnny</text> + <text x='10' y='245'>Ben</text> + <text x='10' y='263'>Alvin</text> + <text x='10' y='281'>Josh</text> + <text x='10' y='299'>Alastair</text> + <text x='10' y='317'>Olodus</text> + <text x='10' y='335'>Aren</text> + <text x='10' y='353'>Dimitri</text> + <text x='10' y='371'>Alexander</text> + <text x='10' y='389'>Mathias</text> + <text x='10' y='407'>m-lima</text> + <text x='10' y='425'>Dunya</text> + <text x='10' y='443'>Benjamin</text> + <g stroke-width='6' class='green'> + <path d='M90 60.5h500'/> + <path d='M90 78.5h500'/> + <path d='M90 96.5h440M550 96.5h40'/> + <path d='M90 114.5h440'/> + <path d='M90 132.5h220M330 132.5h60M410 132.5h40M470 132.5h40M550 132.5h40'/> + <path d='M90 150.5h360M470 150.5h40'/> + <path d='M90 168.5h300'/> + <path d='M90 186.5h220M330 186.5h40'/> + <path d='M90 204.5h60M170 204.5h60M290 204.5h60M370 204.5h20M410 204.5h20M470 204.5h20'/> + <path d='M90 222.5h140M250 222.5h40'/> + <path d='M90 240.5h140'/> + <path d='M90 258.5h140'/> + <path d='M90 276.5h140'/> + <path d='M90 294.5h20M130 294.5h20M190 294.5h40M250 294.5h20'/> + <path d='M90 312.5h60M250 312.5h20'/> + <path d='M190 330.5h40M250 330.5h20'/> + <path d='M90 348.5h20M130 348.5h20'/> + <path d='M130 366.5h20'/> + <path d='M130 384.5h20'/> + <path d='M90 402.5h20'/> + <path d='M90 420.5h20'/> + <path d='M90 438.5h20'/> + </g> + </g> +</svg> + <p>In addition to these, Leah wrote two blog posts explaining her solutions for <a href="https://leahneukirchen.org/blog/archive/2021/12/counting-lanternfish-with-bqn-and-linear-algebra.html">day 6</a> and <a href="https://leahneukirchen.org/blog/archive/2021/12/surveying-lava-basins-with-bqn-and-fixpoints.html">day 9</a>.</p> <p>The number of solutions for each of the 25 days is plotted below, along with totals from AoC's <a href="https://adventofcode.com/2021/stats">stats page</a>. The BQN solutions are scaled to be visible here: there are 6839 times more valid AoC submissions than published BQN solutions overall.</p> <svg viewBox='-40 -25 336 178'> @@ -44,8 +130,7 @@ <text dy='1em' x='128' y='128'>day</text> <text transform='rotate(-90)' dy='-0.35em' x='-64' y='0'>count</text> </g> - <path class='Paren' stroke='currentColor' d='M0 0V128'/> - <path class='Paren' stroke='currentColor' d='M0 128H256'/> + <path class='Paren' stroke='currentColor' fill='none' d='M0 0V128H256'/> <path class='red' style='fill:none' d='M0 0L10.667 21.264L21.333 34.323L32 67.236L42.667 74.891L53.333 74.614L64 77.743L74.667 83.081L85.333 86.676L96 90.878L106.667 95.52L117.333 99.675L128 99.124L138.667 99.02L149.333 105.35L160 109.476L170.667 109.563L181.333 114.835L192 119.484L202.667 115.945L213.333 114.298L224 116.936L234.667 120.62L245.333 122.454L256 120.653'/> <path class='green' style='fill:none' d='M0 49.776L10.667 70.361L21.333 53.893L32 78.595L42.667 74.478L53.333 66.244L64 66.244L74.667 95.063L85.333 78.595L96 90.946L106.667 90.946L117.333 99.18L128 90.946L138.667 95.063L149.333 95.063L160 107.415L170.667 99.18L181.333 103.298L192 111.532L202.667 99.18L213.333 103.298L224 111.532L234.667 119.766L245.333 111.532L256 111.532'/> </g> |
