Skip to content

Instantly share code, notes, and snippets.

@Saturate
Last active December 3, 2018 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Saturate/b58fc980033cf515d50f33a3b79923a5 to your computer and use it in GitHub Desktop.
Save Saturate/b58fc980033cf515d50f33a3b79923a5 to your computer and use it in GitHub Desktop.
Advent Of Code 2018
(function(){
// Load the data from the page
const data = document.body.innerText.split('\n');
// Do the calculations!
let answer = data.reduce((total, feqChange) => total + Number(feqChange), 0);
// Tell us cool stories, bro!
console.log(`Answer is: ${answer}, copied to clipboard!`);
copy(answer);
})()
(function(){
// Load the data from the page
const data = document.body.innerText.split('\n');
// Do the calculations!
const seen = new Set();
// Loopi-deloop-thingy!
// Tell us cool stories, bro!
console.log(`Answer is: ${answer}, copied to clipboard!`);
copy(answer);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment