diff options
Diffstat (limited to '2023/day25.rs')
| -rw-r--r-- | 2023/day25.rs | 39 |
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); +} |
