aboutsummaryrefslogtreecommitdiff
path: root/2022/17/a.rs
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-07-04 15:32:49 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-07-04 15:32:49 +0200
commit19b7ee46b55ed25f77fd030ccc473c8cf95e07b5 (patch)
tree80846c02487cb1424c4c6778f9771ab981b0b822 /2022/17/a.rs
parent36c94296df6edce01db71afeadb8940e33ecdd4a (diff)
downloadaoc-19b7ee46b55ed25f77fd030ccc473c8cf95e07b5.tar.gz
aoc-19b7ee46b55ed25f77fd030ccc473c8cf95e07b5.zip
Day 17 2022 bleah
Diffstat (limited to '2022/17/a.rs')
-rw-r--r--2022/17/a.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/2022/17/a.rs b/2022/17/a.rs
new file mode 100644
index 0000000..18e72e4
--- /dev/null
+++ b/2022/17/a.rs
@@ -0,0 +1,16 @@
1mod common;
2use common::*;
3
4fn main() {
5 let mut screen = Screen::new();
6 let rocks = get_rocks();
7 let mut line = String::new();
8 let _ = std::io::stdin().read_line(&mut line);
9 let line = &line[0..line.len()-1]; // remove newline
10
11 let mut t = 0;
12 for i in 0..2022 {
13 screen.drop_rock(&rocks[i%5], &mut t, &line);
14 }
15 println!("{}", screen.top);
16}

Generated with cgit - Back to sebastiano.tronto.net