Advent of Code

Nick Niemeir walked me through signing up and solving my first "Advent of Code" puzzle. site

pages/advent-of-code

My code prints the answers unique to my assigned test input. Click above to run any puzzle. Choose View Page Source to see my solution. Here is the first day.

http://ward.dojo.fed.wiki/assets/pages/advent-of-code/code.1.html HEIGHT 30

I write a one sentence description of each puzzle part as a code comment also shown here.

http://ward.dojo.fed.wiki/assets/pages/advent-of-code/what.html HEIGHT 200

The puzzles coax me into some seldom used features of javascript. I'll post my most unexpected line of code from each of my solutions.

// puzzle 1 part 2 lists[0] .map(a => a * lists[1] .filter(b => b == a) .length)

// puzzle 2 part 2 report => safe(report) || report.some((level,i) => safe(report.toSpliced(i,1)))

// puzzle 3 part 2 const maybe = text.split(/do\(\)/) const yes = maybe.map(may => may.split(/don't\(\)/)[0])