#![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 = Vec>; fn str_to_num( let mut hm: HashMap<&str, usize> = HashMap::new(); fn main() { let args: Vec = 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 = 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); }