Skip to content

zeltbrennt/adventOfCode2016

Repository files navigation

Advent of Code 2016

In this repo, I will solve Advent-Of-Code problems from 2016 in JavaScript. If possible I will try to come up with a visualization of the solution. These visualizations might be much slower than the original solution (because of animation). Not every Problem lends itself to a nice visual representation.

Day 01: No Time for a Taxicab

  • problem: Manhattan Distance
  • insight: reading input in JS
  • visuals: breadcrumbs and distance

Day 02: Bathroom Security

  • problem: moving through a 2D-Grid
  • insight: setting up boundaries for non rectangle shapes
  • visuals: tried, but was boring

Day 03: Squares With Three Sides

  • problem: check valid triangles
  • insight: constructing the triangles was more fun
  • visuals: visual proof of possible triangles

Day 04: Security Through Obscurity

  • problem: checksums on strings and ceasar cypher
  • insight: sorting functions!
  • visuals: none

Day 05: How About a Nice Game of Chess?

  • problem: MD5 checksums
  • insight: bruteforce, JavaScript slow
  • visuals: none

Day 06: Signals and Noise

  • problem: most / least frequent letter in String
  • insight: functions as arguments
  • visuals: none

Day 07: Internet Protocol Version 7

  • problem: finding repeated letters with overlap
  • insight: regex and resetting match-index
  • visuals: none

Day 08: Two-Factor Authentification

  • problem: manipulate 2D-Array
  • insight: solution is the visualization
  • visuals: pixel display

Day 09: Explosives in Cyberspace

  • problem: string manipulation
  • insight: don't decompress string, keep track of factors instead

Day 10: Balance Bots

  • problem: directed graph and scrambled input
  • insight: it's basically bubble sort
  • visuals: animated graph showing paths of values

Day 11: Radioisotope Thermoelectric Generators

  • problem: graph traversal, shortest path
  • insight: aggressive pruning is key, solution might not be generally correct
  • visuals: WIP

Day 12: Leonardos Monorail

  • problem: parse asembly code
  • insight: simple is good enough
  • visuals: none

Day 13: A Maze of Twisty Little Cubicles

  • problem: maze navigation, shortest path
  • insight: generative function instead of knowledge of whole maze
  • visuals: pathfinder

Day 14: One-Time Pad

  • problem: hashing and salting
  • insight: precomputing is key
  • visuals: none

Day 15: Timing is Everything

  • problem: predetermine a certain state
  • insight: analytic answer might be possible, but brut force works fast enough
  • visuals: the last few seconds, before the solution

Day 16: Dragon Checksum

  • problem: recursive generation
  • insight: analytic answer might be possible, but brut force works fast enough
  • visuals: none

Day 17: Two Steps Forward

  • problem: navigating a changing maze
  • insight: BFS and DFS, no circles possible
  • visuals: WIP

Day 18: Like a Rogue

  • problem: enforce simple rules
  • insight: again, brute force works
  • visuals: in console

Day 19: An Elephant Named Joseph

  • problem: determine final state, not trivial
  • insight: brute force not working, but Josephus-Problem (thank you, Numberphile!)
  • visuals: none

About

Solve Advent of Code 2016 visually in P5js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published