Skip to content

Commit

Permalink
finished rust day 24
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-the-Bomb committed Jan 5, 2024
1 parent 288072a commit d8ee04e
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["-Ctarget-cpu=native"]
233 changes: 226 additions & 7 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ overflow-checks = true
lto = "fat"

[dependencies]
rustworkx-core = "0.13"
rustworkx-core = "0.13"
nalgebra = "0.32"
astro_nalgebra = "0.1"
4 changes: 3 additions & 1 deletion aoc-py/solutions/day24.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ def part_two_linalg(self, inp: str) -> int:
hs1.z_pos * hs1.y_vel - hs3.z_pos * hs3.y_vel - (hs1.y_pos * hs1.z_vel - hs3.y_pos * hs3.z_vel),
])

return round(sum(np.linalg.solve(a, b)[:3])) # type: ignore (`solve` function is not known)
return round(
sum(np.linalg.solve(a, b)[:3]) # type: ignore (`solve` function is not known)
)

def part_two(self, inp: str) -> int:
"""Part 2 solved using z3-solver"""
Expand Down
Loading

0 comments on commit d8ee04e

Please sign in to comment.