AdventOfCode2020.jl icon indicating copy to clipboard operation
AdventOfCode2020.jl copied to clipboard

Advent of Code 2020 in Julia

CI Code coverage

AdventOfCode2020.jl

This Julia package contains my solutions for Advent of Code 2020.

Overview

Day Problem Time Allocated memory Source
1 :white_check_mark: 35.712 μs 17.25 KiB :white_check_mark:
2 :white_check_mark: 508.126 μs 454.77 KiB :white_check_mark:
3 :white_check_mark: 120.052 μs 44.17 KiB :white_check_mark:
4 :white_check_mark: 1.582 ms 1.45 MiB :white_check_mark:
5 :white_check_mark: 425.170 μs 85.20 KiB :white_check_mark:
6 :white_check_mark: 2.224 ms 2.29 MiB :white_check_mark:
7 :white_check_mark: 3.311 ms 1.86 MiB :white_check_mark:
8 :white_check_mark: 19.150 ms 5.57 MiB :white_check_mark:
9 :white_check_mark: 591.718 μs 119.36 KiB :white_check_mark:
10 :white_check_mark: 20.432 μs 17.84 KiB :white_check_mark:
11 :white_check_mark: 49.647 ms 217.98 KiB :white_check_mark:
12 :white_check_mark: 343.275 μs 488.27 KiB :white_check_mark:
13 :white_check_mark: 32.554 μs 35.38 KiB :white_check_mark:
14 :white_check_mark: 15.288 ms 21.10 MiB :white_check_mark:
15 :white_check_mark: 373.204 ms 114.45 MiB :white_check_mark:
16 :white_check_mark: 11.049 ms 8.50 MiB :white_check_mark:
17 :white_check_mark: 48.215 ms 439.09 KiB :white_check_mark:
18 :white_check_mark: 5.157 ms 3.91 MiB :white_check_mark:
19 :white_check_mark: 132.680 ms 176.67 MiB :white_check_mark:
20 :white_check_mark: 145.712 ms 51.68 MiB :white_check_mark:
21 :white_check_mark: 1.845 ms 2.25 MiB :white_check_mark:
22 :white_check_mark: 286.649 ms 141.67 MiB :white_check_mark:
23 :white_check_mark: 209.366 ms 11.45 MiB :white_check_mark:
24 :white_check_mark: 393.255 ms 71.30 MiB :white_check_mark:
25 :white_check_mark: 74.268 ms 400 bytes :white_check_mark:

The benchmarks have been measured on this machine:

Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)

Installation and Usage

Make sure you have Julia 1.5 or newer installed on your system.

Installation

Start Julia and enter the package REPL by typing ]. Create a new environment:

(@v1.5) pkg> activate aoc

Install AdventOfCode2020.jl:

(aoc) pkg> add https://github.com/goggle/AdventOfCode2020.jl

Go back to the Julia REPL by pushing the backspace button.

Usage

First, activate the package:

julia> using AdventOfCode2020

Each puzzle can now be run with dayXY():

julia> day01()
2-element Array{Int64,1}:
  1007104
 18847752

This will use my personal input. If you want to use another input, provide it to the dayXY method as a string. You can also use the readInput method to read your input from a text file:

julia> input = readInput("/path/to/input.txt")

julia> AdventOfCode2020.Day01.day01(input)
2-element Array{Int64,1}:
  1007104
 18847752