Started on aoc day 12

This commit is contained in:
2023-01-03 10:04:42 +01:00
parent 662baa4fc4
commit 45b01ca65c
5 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
use std::collections::HashMap;
fn main() {
let test_input = include_str!("../test.txt")
.split_whitespace()
.collect::<Vec<&str>>();
let mut start = (0, 0);
let mut end = (0, 0);
let mut points : HashMap<(u32, u32), u32> = HashMap::new();
let mut y = 0;
for line in test_input {
let mut x = 0;
for ch in line.chars() {
let mut c = ch;
if c == 'S' {
c = 'a';
start = (x, y);
}
if c == 'E' {
c = 'z';
end = (x, y);
}
points.insert((x, y), c as u32 - 'a' as u32);
x += 1;
}
y += 1;
}
}