Skip to content

goggle/AdventOfCode2020.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Code coverage

AdventOfCode2020.jl

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

Overview

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

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