2020 day 12 + visualisation

This commit is contained in:
tristan 2020-12-12 18:34:40 +00:00
parent 29b64b4715
commit 171802a184
8 changed files with 1038 additions and 3 deletions

View file

@ -1,5 +1,5 @@
const fs = require('fs');
const data = fs.readFileSync('input.txt', 'utf-8');
const data = fs.readFileSync('./input.txt', 'utf-8');
const lines = data.split('\n').map(num => parseInt(num)).sort((a,b)=>(a-b));
lines.unshift(0); // add the outlet with joltage 0
lines.push(lines[lines.length-1]+3); // your device has a joltage 3 above the highest