AdventOfCode2022.jl
AdventOfCode2022.jl copied to clipboard
Advent of Code 2022 in Julia
AdventOfCode2022.jl
This Julia package contains my solutions for Advent of Code 2022.
Overview
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