Skip to content

Commit

Permalink
2024-05 Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
jurisk committed Dec 5, 2024
1 parent c963ed2 commit 45f055f
Show file tree
Hide file tree
Showing 10 changed files with 1,775 additions and 10 deletions.
1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

| Year-Day | Task | Scala | Rust | Others |
|----------|:-------------------------------------------------------------------------------|:-----------------------------------------------------------------------:|:----------------------------------------------:|:----------------------------------------------------------------------:|
| 2024-05 | [Print Queue](https://adventofcode.com/2024/day/5) | [Scala](scala2/src/main/scala/jurisk/adventofcode/y2024/Advent05.scala) | [Rust](rust/y2024/src/bin/solution_2024_05.rs) | |
| 2024-04 | [Ceres Search](https://adventofcode.com/2024/day/4) | [Scala](scala2/src/main/scala/jurisk/adventofcode/y2024/Advent04.scala) | [Rust](rust/y2024/src/bin/solution_2024_04.rs) | |
| 2024-03 | [Mull It Over](https://adventofcode.com/2024/day/3) | [Scala](scala2/src/main/scala/jurisk/adventofcode/y2024/Advent03.scala) | [Rust](rust/y2024/src/bin/solution_2024_03.rs) | |
| 2024-02 | [Red-Nosed Reports](https://adventofcode.com/2024/day/2) | [Scala](scala2/src/main/scala/jurisk/adventofcode/y2024/Advent02.scala) | [Rust](rust/y2024/src/bin/solution_2024_02.rs) | |
Expand Down
152 changes: 150 additions & 2 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ num-bigint = "0.4"
nalgebra = "0.33"
memoize = "0.4"
nom = "7.1"
chumsky = "0.9"
regex = "1.9"
rand = "0.8"
bimap = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion rust/common/src/grid2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ where
type Err = T::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
parse_matrix(s, |ch| ch.try_into()).map(|data| MatrixGrid2D { data })
parse_matrix(s, TryInto::try_into).map(|data| MatrixGrid2D { data })
}
}
2 changes: 1 addition & 1 deletion rust/y2024/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ workspace = true

[dependencies]
advent-of-code-common = { path = "../common" }
pathfinding.workspace = true
chumsky.workspace = true
itertools.workspace = true
regex.workspace = true
28 changes: 28 additions & 0 deletions rust/y2024/resources/05-test-00.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
47|53
97|13
97|61
97|47
75|29
61|13
75|53
29|13
97|29
53|29
61|53
97|53
61|29
47|13
75|47
97|75
47|61
75|61
47|29
75|13
53|13

75,47,61,53,29
97,61,53,29,13
75,29,13
75,97,47,61,53
61,13,29
97,13,75,29,47
Loading

0 comments on commit 45f055f

Please sign in to comment.