2024-12-05 19:47:50 +03:00
|
|
|
mod day1;
|
|
|
|
mod day2;
|
|
|
|
mod day3;
|
|
|
|
mod day4;
|
|
|
|
mod day5;
|
2024-12-06 17:16:21 +03:00
|
|
|
mod day6;
|
2024-12-05 19:47:50 +03:00
|
|
|
|
2024-12-01 15:10:20 +03:00
|
|
|
use std::{
|
|
|
|
fs::File,
|
2024-12-02 20:42:43 +03:00
|
|
|
io::{BufRead as _, BufReader},
|
2024-12-01 15:10:20 +03:00
|
|
|
};
|
|
|
|
|
2024-12-02 20:42:43 +03:00
|
|
|
fn get_lines(name: &str) -> impl Iterator<Item = String> {
|
|
|
|
BufReader::new(File::open(name).unwrap())
|
|
|
|
.lines()
|
|
|
|
.map(|line| line.unwrap())
|
|
|
|
}
|
|
|
|
|
2024-12-05 19:47:50 +03:00
|
|
|
fn parse_line(line: &str, pattern: char) -> impl Iterator<Item = i32> + '_ {
|
|
|
|
line.trim().split(pattern).map(|num| num.parse().unwrap())
|
2024-12-05 17:51:04 +03:00
|
|
|
}
|
|
|
|
|
2024-12-01 15:10:20 +03:00
|
|
|
fn main() {
|
2024-12-06 17:16:21 +03:00
|
|
|
day6::task1();
|
|
|
|
day6::task2();
|
2024-12-01 15:10:20 +03:00
|
|
|
}
|