Skip to content

tinc2k/advent2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2019 🎄

Once again, I've decided to semi-seriously take part in this year's Advent of Code. I'll be solving this year's puzzles in JavaScript.

  • Math.round() vs. Math.floor()
  • recursion in part two
  • memory, instructions, instruction pointer
  • tried to copy an Array by doing arr.splice() without args which doesn't work, went with arr.concat([]) instead
  • remeber Manhattan distance?
  • tried to rewrite an ugly if-then (4 possible single-character options) into a switch-case, looked even uglier. fuck switch-case.
  • TODO my variable/function naming sucks, how can we improve?
  • TODO should we try visualizing the 'wires'? would that look cool?
  • reading and concentrating on the task was the hardest part, the implementation itself is quite trivial
  • TODO tidy up
  • had to Google for part 2, decided on a pretty limited data structure for part 1 and didn't know how to quickly dig myself out of that
  • figured finding common ancestor would be the way to go, if we're already traversing each object's path backward towards root, might as well return the paths & compare
  • TODO do a couple more Tree, Graph, shortest-path, Dijkstra problems to remember / learn more
  • playing with characters, but not much learned otherwise?
  • TODO parsing integers in current solution, but we might go back to string form, as we don't really need integers right?

About

Advent of Code 2019

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published