aboutsummaryrefslogtreecommitdiff
path: root/2022/17/a.rs
diff options
context:
space:
mode:
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