rust: Fix input paths for days 1 through 8
This commit is contained in:
parent
90e0a3060e
commit
02037cae7a
|
@ -1,7 +1,7 @@
|
|||
use std::{collections::HashMap, time::Duration, time::Instant};
|
||||
|
||||
pub fn run(print: bool) -> Duration {
|
||||
let file_string = std::fs::read_to_string("inputs/day01").unwrap();
|
||||
let file_string = std::fs::read_to_string("../inputs/01").unwrap();
|
||||
let instant = Instant::now();
|
||||
|
||||
let entries: Vec<usize> = file_string.lines().flat_map(|line| line.parse()).collect();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
pub fn run(print: bool) -> Duration {
|
||||
let file_string = std::fs::read_to_string("inputs/day02").unwrap();
|
||||
let file_string = std::fs::read_to_string("../inputs/02").unwrap();
|
||||
let instant = Instant::now();
|
||||
|
||||
let rules: Vec<(usize, usize, char, &str)> = file_string
|
||||
|
|
|
@ -16,7 +16,7 @@ fn count(rows: &[Vec<char>], dx: usize, dy: usize) -> usize {
|
|||
}
|
||||
|
||||
pub fn run(print: bool) -> Duration {
|
||||
let file_string = std::fs::read_to_string("inputs/day3").unwrap();
|
||||
let file_string = std::fs::read_to_string("../inputs/03").unwrap();
|
||||
|
||||
let instant = Instant::now();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ fn between(field: &str, lower: i32, higher: i32) -> bool {
|
|||
}
|
||||
|
||||
pub fn run(print: bool) -> Duration {
|
||||
let input = std::fs::read_to_string("inputs/day04").unwrap();
|
||||
let input = std::fs::read_to_string("../inputs/04").unwrap();
|
||||
|
||||
let now = Instant::now();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
pub fn run(print: bool) -> Duration {
|
||||
let input = std::fs::read_to_string("inputs/day05").unwrap();
|
||||
let input = std::fs::read_to_string("../inputs/05").unwrap();
|
||||
let instant = Instant::now();
|
||||
|
||||
let passes: Vec<_> = input.lines().collect();
|
||||
|
|
|
@ -62,7 +62,7 @@ fn part2(instructions: &[Instruction], skip: i32) -> Option<i32> {
|
|||
}
|
||||
|
||||
pub fn run(print: bool) -> Duration {
|
||||
let input = std::fs::read_to_string("inputs/day08").unwrap();
|
||||
let input = std::fs::read_to_string("../inputs/08").unwrap();
|
||||
let instant = Instant::now();
|
||||
|
||||
let instructions: Vec<_> = input
|
||||
|
|
Loading…
Reference in New Issue