Skip to content

Commit 2628464

Browse files
committed
initial commit
0 parents  commit 2628464

File tree

11 files changed

+100
-0
lines changed

11 files changed

+100
-0
lines changed

.github/workflows/rust.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
submodules: 'true'
21+
- name: Build
22+
run: cargo build --verbose
23+
- name: Run tests
24+
run: cargo test --verbose

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target
2+
inputs
3+
.session
4+
Cargo.lock
5+
flamegraph.svg
6+
perf.*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "aoc_lib"]
2+
path = aoc_lib
3+
url = [email protected]:tom-anders/AdventOfCodeLib.git

Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"aoc_lib/aoc_derive",
5+
"aoc_lib/utils", "day15", "day16",
6+
]
7+
8+
[workspace.dependencies]
9+
derive_more = {version = "2.0.1", features = ["full"]}
10+
itertools = "0.13.0"
11+
ndarray = "0.16.1"
12+
num = "0.4"
13+
parse-display = "0.10.0"
14+
priority-queue = "2.1"
15+
rayon = "1.10"
16+
regex = {version = "1.11", features = ["pattern"]}
17+
lazy-regex = "3.3.0"
18+
pretty_assertions = "1.4.0"
19+
dot-writer="0.1.3"

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Advent of Code 2024
2+
3+
My solutions for the 2024 edition of [Advent of Code](adventofcode.com) written in Rust.
4+
5+
Each day, I usually go for speed, and after getting both stars will refactor the solution to be (even more) idiomatic
6+
Rust code.
7+
8+
## Project Layout
9+
10+
The project uses cargo's workspace feature, each day is a separate workspace member. `utils` contains various helpers
11+
for things that come up a lot in AoC, including some basic math stuff (2D vector, box and grid), algorithms (bfs,
12+
dijkstra, ..) and helpers for parsing strings into data via regular expressions.
13+
14+
`aoc_derive` implements the `#[aoc_main]` proc_macro that implements the `main()` function for each day.
15+
16+
There's also an `init_day.sh` script that will download my input into a file, create the project for the day and will
17+
open the `main.rs` in neovim with some AoC-specific key-bindings and window layout (see `aoc.lua`). The scripts expects
18+
your [session cookie](https://github.com/wimglenn/advent-of-code-wim/issues/1) to be in the `.session` file.

aoc.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aoc_lib/aoc.lua

aoc_lib

Submodule aoc_lib added at 1476fed

init_day.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aoc_lib/init_day.sh

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "nightly"

0 commit comments

Comments
 (0)