summaryrefslogtreecommitdiff
path: root/2023/day25.rs
diff options
context:
space:
mode:
authornekineki <nekineki@nekineki.net>2024-12-02 17:48:12 +0100
committernekineki <nekineki@nekineki.net>2024-12-02 17:48:12 +0100
commitae1a0ae37bdb52a55acd1f0b3442cf2a93cacc31 (patch)
tree247e3048102d22c3f082184bc716e58d16424b5e /2023/day25.rs
parent68c88b6a738bbec01f1fe498c33b9372139b02cc (diff)
add uncommited stuff from 2023
Diffstat (limited to '2023/day25.rs')
-rw-r--r--2023/day25.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/2023/day25.rs b/2023/day25.rs
new file mode 100644
index 0000000..d622bdd
--- /dev/null
+++ b/2023/day25.rs
@@ -0,0 +1,39 @@
+#![allow(dead_code)]
+#![allow(unused_variables)]
+#![allow(unused_mut)]
+use std::env;
+use std::fs::File;
+use std::io::Read;
+use std::collections::HashMap;
+
+type Matrix<T> = Vec<Vec<T>>;
+
+fn str_to_num( let mut hm: HashMap<&str, usize> = HashMap::new();
+
+fn main() {
+ let args: Vec<String> = env::args().collect();
+ let filename = if args.len() == 1 {
+ "in/".to_owned() + args[0].split('/').last().unwrap() + ".pzl"
+ } else {
+ args[1].clone()
+ };
+ let mut f = File::open(filename).expect("cannot open file");
+ let mut content = String::new();
+ f.read_to_string(&mut content).expect("cannot read file");
+ let lines: Vec<_> = content.trim_end().split('\n').collect();
+
+ let mut m: Matrix<bool> = vec![vec![false; lines.len()]; lines.len()];
+ let mut hm: HashMap<&str, usize> = HashMap::new();
+
+ let mut n = 0;
+ for line in lines.iter() {
+ let (a, b) = line.split_once(": ").unwrap();
+ println!("{} {}", a, b);
+ }
+
+ let mut res1 = 0;
+ let mut res2 = 0;
+
+ println!("res1: {}", res1);
+ println!("res2: {}", res2);
+}