Skip to content

Latest commit

 

History

History

2019

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Advent of Code 2019

This is my second attempt at Advent of Code 🎅🏻, my first time around I only lasted a couple of days. My language of choice is ReasonML, same as last year.

Advent of Code 2019 Story

Santa has become stranded at the edge of the Solar System while delivering presents to other planets! To accurately calculate his position in space, safely align his warp drive, and return to Earth in time to save Christmas, he needs you to bring him measurements from fifty stars.

Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!

Native Reason

I'm also making some of the solutions in native Reason to compare performance and to have even more fun! Those solutions are found here or via the relevant native link in the table below.

Days

Day #1  #2 Performance Native
Day 1: The Tyranny of the Rocket Equation 🌟 🌟 7 µs / 43 µs Link
Day 2: 1202 Program Alarm 🌟 🌟 5 µs / 202 ms Link
Day 3: Crossed Wires 🌟 🌟 643 ms / 771 ms
Day 4: Secure Container 🌟 🌟 1.483 s / 1.545 s
Day 5: Sunny with a Chance of Asteroids 🌟 🌟 37 µs / 26 µs
Day 6: Universal Orbit Map 🌟 🌟 9456 µs / 338 µs Link
Day 7: Amplification Circuit 🌟 597 µs
Day 8: Space Image Format 🌟 🌟 1.6 ms / 309 µs
Day 10: Monitoring Station 🌟 190 ms
Day 12: The N-Body Problem 🌟 🌟 1301 µs / 3.399 s Link
Day 13: Care Package 🌟 8 µs* Link

Performance

I've tested performance using performance.now() and taken the fastest time from a couple of runs.

Running code and tests

$ git clone https://github.com/believer/advent-of-code.git
$ cd advent-of-code/2019
$ npm install
$ npm run build && npm run test:ci