mirror of
https://github.com/seigler/advent-of-code-browser-console
synced 2025-07-26 00:06:10 +00:00
day 13
This commit is contained in:
parent
fbcef85736
commit
ae2b23fbcf
1 changed files with 1 additions and 0 deletions
1
2021/day13.js
Normal file
1
2021/day13.js
Normal file
|
@ -0,0 +1 @@
|
|||
Q=console.log,[D,F]=$('pre').innerText.trim().split`\n\n`.map(x=>x.split`\n`);D=new Set(D);F=F.map(x=>x.split(/[ =]/));F.map(([z,x,a,n],i)=>{N=new Set();D.forEach(d=>{[x,y]=d.split`,`;a<"y"?N.add(+x>+n?2*n-x+','+y:d):N.add(+y>+n?x+','+(2*n-y):d)});D=N;i<1?Q(D.size):0});for(let x,y=0,L;L="",y<6;y++){for(x=0;x<41;x++)L+=" █"[+D.has(x+','+y)];Q(L)}
|
Loading…
Add table
Add a link
Reference in a new issue