day14: rust
This commit is contained in:
parent
3d5270034b
commit
f3d747b0df
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
Today's language: **Rust**
|
Today's language: **Rust**
|
||||||
|
|
||||||
Lines of code: **84**
|
Lines of code: **85**
|
||||||
|
|
||||||
Execution time: **0,171 s**
|
Execution time: **0,172 s**
|
||||||
|
|
||||||
This solution uses a single function for the tilting procedure.
|
This solution uses a single function for the tilting procedure.
|
||||||
Different tilting directions are achieved by "remapping" `x` and `y` through captures.
|
Different tilting directions are achieved by "remapping" `x` and `y` through captures.
|
||||||
|
@ -72,6 +72,7 @@ fn main() {
|
|||||||
rocks = original.clone();
|
rocks = original.clone();
|
||||||
// find a cycle
|
// find a cycle
|
||||||
let mut rocks_store: Vec<Rocks> = Vec::new();
|
let mut rocks_store: Vec<Rocks> = Vec::new();
|
||||||
|
rocks_store.reserve(200);
|
||||||
let mut cycle_start: usize = 0;
|
let mut cycle_start: usize = 0;
|
||||||
let mut cycle_length: usize = 0;
|
let mut cycle_length: usize = 0;
|
||||||
for i in 0..1_000_000_000 as usize {
|
for i in 0..1_000_000_000 as usize {
|
||||||
|
@ -16,6 +16,6 @@ This is a repository for my solutions for the [advent of code 2023](https://adve
|
|||||||
| [10](10) | Rust | 136 | 0,003 s | lots of bitwise operations |
|
| [10](10) | Rust | 136 | 0,003 s | lots of bitwise operations |
|
||||||
| [11](11) | Rust | 66 | 0,005 s | |
|
| [11](11) | Rust | 66 | 0,005 s | |
|
||||||
| [13](13) | Rust | 84 | 0,002 s | binary encoding ftw |
|
| [13](13) | Rust | 84 | 0,002 s | binary encoding ftw |
|
||||||
| [14](14) | Rust | 84 | 0,171 s | no bruteforce in < 90 lines |
|
| [14](14) | Rust | 85 | 0,172 s | no bruteforce in < 90 lines |
|
||||||
|
|
||||||
Lines of code are without blank lines and comments
|
Lines of code are without blank lines and comments
|
||||||
|
Loading…
Reference in New Issue
Block a user