AdventOfCode2022.jl

Advent of Code 2022 in Julia
Author goggle
Popularity
17 Stars
Updated Last
2 Years Ago
Started In
November 2022

CI

AdventOfCode2022.jl

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

Overview

Day Problem Time Allocated memory Source
1 ✅ 603.795 μs 231.53 KiB ✅
2 ✅ 1.838 ms 1.09 MiB ✅
3 ✅ 1.194 ms 811.64 KiB ✅
4 ✅ 1.512 ms 522.12 KiB ✅
5 ✅ 611.487 μs 329.89 KiB ✅
6 ✅ 2.331 ms 2.85 MiB ✅
7 ✅ 503.759 μs 479.67 KiB ✅
8 ✅ 1.312 ms 804.73 KiB ✅
9 ✅ 11.756 ms 5.73 MiB ✅
10 ✅ 87.203 μs 94.35 KiB ✅
11 ✅ 132.951 ms 68.31 MiB ✅
12 ✅ 623.635 μs 1.02 MiB ✅
13 ✅ 4.571 ms 2.31 MiB ✅
14 ✅ 81.430 ms 2.48 MiB ✅
15 ✅ 27.526 ms 191.84 KiB ✅
16 ✅ 51.303 ms 70.11 MiB ✅
17 ✅ 842.701 ms 574.77 MiB ✅
18 ✅ 6.194 ms 2.94 MiB ✅
19 ✅ 309.718 ms 90.53 MiB ✅
20 ✅ 523.753 ms 1.78 MiB ✅
21 ✅ 7.622 ms 3.37 MiB ✅
22 ✅ 5.858 ms 3.23 MiB ✅
23 ✅ 883.089 ms 274.73 MiB ✅
24 ✅ 243.611 ms 262.58 MiB ✅
25 ✅ 276.473 μs 344.55 KiB ✅

The benchmarks have been measured on this machine:

Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.0 (ORCJIT, skylake)

Installation and Usage

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

Installation

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

(@v1.8) pkg> activate aoc

Install AdventOfCode2022.jl:

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

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

Usage

First, activate the package:

julia> using AdventOfCode2022

Each puzzle can now be run with dayXY():

julia> day01()
2-element Vector{Int64}:
 74711
 209481

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> AdventOfCode2022.Day01.day01(input)
2-element Vector{Int64}:
 74711
 209481