From ae2b23fbcf2dcb29217583c2818f24ecbf96a11a Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Mon, 13 Dec 2021 12:15:23 -0500 Subject: [PATCH] day 13 --- 2021/day13.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 2021/day13.js diff --git a/2021/day13.js b/2021/day13.js new file mode 100644 index 0000000..99ae14a --- /dev/null +++ b/2021/day13.js @@ -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)} \ No newline at end of file