-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rs
40 lines (32 loc) · 777 Bytes
/
main.rs
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
40
use regex::Regex;
use std::{
cmp,
collections::HashMap,
env,
fs::File,
io::{BufRead, BufReader},
};
// #[derive(Eq, PartialEq, Hash, PartialOrd, Ord, Debug)]
pub fn main() {
let args: Vec<String> = env::args().collect();
let filename = &args[1];
let infile = BufReader::new(File::open(filename).expect("Can't open that file"));
let mut lines = infile.lines();
let re = Regex::new(
r"^Sensor at x=([-]?\d+), y=([-]?\d+): closest beacon is at x=([-]?\d+), y=([-]?\d+)$",
).unwrap();
while let Some(input) = lines.next() {
if let Ok(line) = input {
// for num in re.captures_iter(&line) {
// }
}
}
part1();
part2();
}
fn part1() {
println!("Part one: answer = ");
}
fn part2() {
println!("Part two: answer = ");
}