summaryrefslogtreecommitdiff
path: root/2023/day25.rs
blob: d622bdd74dec57846ccff9795cb5734269ccd7a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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);
}