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

Advent of Code 2022 in Julia

CI

AdventOfCode2022.jl

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

Overview

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