AdventOfCode2023.jl
Advent of Code 2023 in Julia
Install / Use
/learn @goggle/AdventOfCode2023.jlREADME
AdventOfCode2023
<!-- [](https://github.com/goggle/AdventOfCode2023.jl/actions?query=workflow%3ACI+branch%3Amaster) --> <!-- [](https://codecov.io/github/goggle/AdventOfCode2023.jl?branch=master) -->This Julia package contains my solutions for Advent of Code 2023.
Overview
| Day | Problem | Time | Allocated memory | Source | |----:|:-------:|-----:|-----------------:|:------:| | 1 | :white_check_mark: | 2.304 ms | 3.00 MiB | :white_check_mark: | | 2 | :white_check_mark: | 1.050 ms | 350.39 KiB | :white_check_mark: | | 3 | :white_check_mark: | 1.894 ms | 1.80 MiB | :white_check_mark: | | 4 | :white_check_mark: | 2.745 ms | 1.40 MiB | :white_check_mark: | | 5 | :white_check_mark: | 71.969 ms | 198.09 KiB | :white_check_mark: | | 6 | :white_check_mark: | 7.953 μs | 7.44 KiB | :white_check_mark: | | 7 | :white_check_mark: | 11.831 ms | 15.28 MiB | :white_check_mark: | | 8 | :white_check_mark: | 11.879 ms | 556.42 KiB | :white_check_mark: | | 9 | :white_check_mark: | 1.408 ms | 1.72 MiB | :white_check_mark: | | 10 | :white_check_mark: | 7.801 ms | 7.78 MiB | :white_check_mark: | | 11 | :white_check_mark: | 4.728 ms | 1.71 MiB | :white_check_mark: | | 12 | :white_check_mark: | 9.320 ms | 2.64 MiB | :white_check_mark: | | 13 | :white_check_mark: | 2.202 ms | 3.18 MiB | :white_check_mark: | | 14 | :white_check_mark: | 56.620 ms | 22.56 MiB | :white_check_mark: | | 15 | :white_check_mark: | 2.647 ms | 1.49 MiB | :white_check_mark: | | 16 | :white_check_mark: | 33.972 ms | 53.35 MiB | :white_check_mark: | | 17 | :white_check_mark: | 50.170 ms | 2.72 MiB | :white_check_mark: | | 18 | :white_check_mark: | 630.330 μs | 484.14 KiB | :white_check_mark: | | 19 | :white_check_mark: | 2.559 ms | 1.79 MiB | :white_check_mark: | | 20 | :white_check_mark: | 65.710 ms | 28.76 MiB | :white_check_mark: | | 21 | :white_check_mark: | 9.675 ms | 7.19 MiB | :white_check_mark: | | 22 | :white_check_mark: | 790.712 ms | 631.26 MiB | :white_check_mark: | | 23 | :white_check_mark: | 2.979 s | 9.69 MiB | :white_check_mark: | | 24 | :white_check_mark: | 43.214 ms | 49.77 MiB | :white_check_mark: | | 25 | :white_check_mark: | 69.476 ms | 62.03 MiB | :white_check_mark: |
The benchmarks have been measured on this machine:
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
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 AdventOfCode2023.jl:
(aoc) pkg> add https://github.com/goggle/AdventOfCode2023.jl
Go back to the Julia REPL by pushing the backspace key.
Usage
First, activate the package:
julia> using AdventOfCode2023
Each puzzle can now be run with dayXY():
julia> day01()
2-element Vector{Int64}:
54708
54087
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> AdventOfCode2023.Day01.day01(input)
2-element Vector{Int64}:
54708
54087
