RustFmt on all the things
This commit is contained in:
parent
7bee28bdf6
commit
2251854f9c
7 changed files with 138 additions and 95 deletions
|
@ -29,14 +29,18 @@ fn get_calorie_totals<R: Read + BufRead>(lines: Lines<R>) -> Result<Vec<u32>> {
|
||||||
pub fn main(input_filename: &str) -> Result<()> {
|
pub fn main(input_filename: &str) -> Result<()> {
|
||||||
let line_reader = line_reader_for_file(input_filename)
|
let line_reader = line_reader_for_file(input_filename)
|
||||||
.expect(format!("Unable to create line reader for file: {}", input_filename).as_str());
|
.expect(format!("Unable to create line reader for file: {}", input_filename).as_str());
|
||||||
let elves = get_calorie_totals(line_reader)
|
let elves = get_calorie_totals(line_reader).expect("Unable to get knapsack calorie totals");
|
||||||
.expect("Unable to get knapsack calorie totals");
|
|
||||||
|
|
||||||
println!("Part 1: Elf with highest calorie count in knapsack: {}", elves[0]);
|
println!(
|
||||||
|
"Part 1: Elf with highest calorie count in knapsack: {}",
|
||||||
|
elves[0]
|
||||||
|
);
|
||||||
|
|
||||||
let sum_of_top_three = &elves[0] + &elves[1] + &elves[2];
|
let sum_of_top_three = &elves[0] + &elves[1] + &elves[2];
|
||||||
println!("Part 2: Elves with top 3 highest calorie counts in their knapsacks: {}, {}, {} = {}",
|
println!(
|
||||||
&elves[0], &elves[1], &elves[2], sum_of_top_three);
|
"Part 2: Elves with top 3 highest calorie counts in their knapsacks: {}, {}, {} = {}",
|
||||||
|
&elves[0], &elves[1], &elves[2], sum_of_top_three
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,11 @@ const SCORE_FOR_DRAW: i32 = 3;
|
||||||
const SCORE_FOR_LOSS: i32 = 0;
|
const SCORE_FOR_LOSS: i32 = 0;
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, PartialEq, PartialOrd)]
|
||||||
enum Shape { Rock, Paper, Scissors }
|
enum Shape {
|
||||||
|
Rock,
|
||||||
|
Paper,
|
||||||
|
Scissors,
|
||||||
|
}
|
||||||
|
|
||||||
impl Shape {
|
impl Shape {
|
||||||
fn part1_from_string(s: &str) -> Option<Shape> {
|
fn part1_from_string(s: &str) -> Option<Shape> {
|
||||||
|
@ -68,7 +72,11 @@ impl Shape {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, PartialEq, PartialOrd)]
|
||||||
enum Outcome { Win, Draw, Loss }
|
enum Outcome {
|
||||||
|
Win,
|
||||||
|
Draw,
|
||||||
|
Loss,
|
||||||
|
}
|
||||||
|
|
||||||
impl Outcome {
|
impl Outcome {
|
||||||
fn part2_from_string(s: &str) -> Option<Outcome> {
|
fn part2_from_string(s: &str) -> Option<Outcome> {
|
||||||
|
@ -76,7 +84,7 @@ impl Outcome {
|
||||||
"X" => Some(Outcome::Loss),
|
"X" => Some(Outcome::Loss),
|
||||||
"Y" => Some(Outcome::Draw),
|
"Y" => Some(Outcome::Draw),
|
||||||
"Z" => Some(Outcome::Win),
|
"Z" => Some(Outcome::Win),
|
||||||
_ => None
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,27 +111,29 @@ struct Round {
|
||||||
impl Round {
|
impl Round {
|
||||||
fn part1_from_string(s: &str) -> Option<Round> {
|
fn part1_from_string(s: &str) -> Option<Round> {
|
||||||
let split: Vec<&str> = s.split(" ").collect();
|
let split: Vec<&str> = s.split(" ").collect();
|
||||||
match (Shape::part1_from_string(split[0]), Shape::part1_from_string(split[1])) {
|
match (
|
||||||
(Some(opponents_shape), Some(my_shape)) => {
|
Shape::part1_from_string(split[0]),
|
||||||
Some(Round {
|
Shape::part1_from_string(split[1]),
|
||||||
me: my_shape,
|
) {
|
||||||
outcome: Outcome::with_shapes(opponents_shape, my_shape)
|
(Some(opponents_shape), Some(my_shape)) => Some(Round {
|
||||||
})
|
me: my_shape,
|
||||||
},
|
outcome: Outcome::with_shapes(opponents_shape, my_shape),
|
||||||
_ => None
|
}),
|
||||||
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn part2_from_string(s: &str) -> Option<Round> {
|
fn part2_from_string(s: &str) -> Option<Round> {
|
||||||
let split: Vec<&str> = s.split(" ").collect();
|
let split: Vec<&str> = s.split(" ").collect();
|
||||||
match (Shape::part2_from_string(split[0]), Outcome::part2_from_string(split[1])) {
|
match (
|
||||||
(Some(opponents_shape), Some(expected_outcome)) => {
|
Shape::part2_from_string(split[0]),
|
||||||
Some(Round {
|
Outcome::part2_from_string(split[1]),
|
||||||
me: Shape::part2_from_shape_and_outcome(opponents_shape, expected_outcome),
|
) {
|
||||||
outcome: expected_outcome
|
(Some(opponents_shape), Some(expected_outcome)) => Some(Round {
|
||||||
})
|
me: Shape::part2_from_shape_and_outcome(opponents_shape, expected_outcome),
|
||||||
},
|
outcome: expected_outcome,
|
||||||
_ => None
|
}),
|
||||||
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +166,8 @@ pub fn main(input_filename: &str) -> Result<()> {
|
||||||
let mut part2_total_score: i32 = 0;
|
let mut part2_total_score: i32 = 0;
|
||||||
|
|
||||||
for line in line_reader {
|
for line in line_reader {
|
||||||
let line = line.expect(format!("Failed to read line after {} rounds!", number_of_rounds).as_str());
|
let line =
|
||||||
|
line.expect(format!("Failed to read line after {} rounds!", number_of_rounds).as_str());
|
||||||
if let Some(round) = Round::part1_from_string(&line) {
|
if let Some(round) = Round::part1_from_string(&line) {
|
||||||
part1_total_score += round.score();
|
part1_total_score += round.score();
|
||||||
}
|
}
|
||||||
|
@ -168,7 +179,10 @@ pub fn main(input_filename: &str) -> Result<()> {
|
||||||
|
|
||||||
println!("Processed {} rounds", number_of_rounds);
|
println!("Processed {} rounds", number_of_rounds);
|
||||||
println!("Part 1: total score two shapes: {}", part1_total_score);
|
println!("Part 1: total score two shapes: {}", part1_total_score);
|
||||||
println!("Part 2: total score with expected outcomes: {}", part2_total_score);
|
println!(
|
||||||
|
"Part 2: total score with expected outcomes: {}",
|
||||||
|
part2_total_score
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,10 @@ fn priority_items_in_knapsack(knapsack: &str) -> Vec<char> {
|
||||||
let left_compartment_set: HashSet<char> = HashSet::from_iter(left_compartment.chars());
|
let left_compartment_set: HashSet<char> = HashSet::from_iter(left_compartment.chars());
|
||||||
let right_compartment_set: HashSet<char> = HashSet::from_iter(right_compartment.chars());
|
let right_compartment_set: HashSet<char> = HashSet::from_iter(right_compartment.chars());
|
||||||
|
|
||||||
left_compartment_set.intersection(&right_compartment_set).map(|c| *c).collect()
|
left_compartment_set
|
||||||
|
.intersection(&right_compartment_set)
|
||||||
|
.map(|c| *c)
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn badge_for_group(group: (&str, &str, &str)) -> Vec<char> {
|
fn badge_for_group(group: (&str, &str, &str)) -> Vec<char> {
|
||||||
|
@ -21,14 +24,8 @@ fn badge_for_group(group: (&str, &str, &str)) -> Vec<char> {
|
||||||
let b_set: HashSet<char> = HashSet::from_iter(group.1.chars());
|
let b_set: HashSet<char> = HashSet::from_iter(group.1.chars());
|
||||||
let c_set: HashSet<char> = HashSet::from_iter(group.2.chars());
|
let c_set: HashSet<char> = HashSet::from_iter(group.2.chars());
|
||||||
|
|
||||||
let ab_intersection: HashSet<char> = a_set
|
let ab_intersection: HashSet<char> = a_set.intersection(&b_set).map(|c| *c).collect();
|
||||||
.intersection(&b_set)
|
ab_intersection.intersection(&c_set).map(|c| *c).collect()
|
||||||
.map(|c| *c)
|
|
||||||
.collect();
|
|
||||||
ab_intersection
|
|
||||||
.intersection(&c_set)
|
|
||||||
.map(|c| *c)
|
|
||||||
.collect()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main(filename: &str) -> Result<()> {
|
pub fn main(filename: &str) -> Result<()> {
|
||||||
|
@ -52,33 +49,34 @@ pub fn main(filename: &str) -> Result<()> {
|
||||||
const LOWERCASE_A_SCORE: u32 = 'a' as u32;
|
const LOWERCASE_A_SCORE: u32 = 'a' as u32;
|
||||||
const UPPERCASE_A_SCORE: u32 = 'A' as u32;
|
const UPPERCASE_A_SCORE: u32 = 'A' as u32;
|
||||||
|
|
||||||
let sum_of_scored_priority_letters: u32 =
|
let sum_of_scored_priority_letters: u32 = priority_letters
|
||||||
priority_letters
|
.iter()
|
||||||
.iter()
|
.map(|c| -> u32 {
|
||||||
.map(|c| -> u32 {
|
let char_value: u32 = (*c).into();
|
||||||
let char_value: u32 = (*c).into();
|
if c.is_lowercase() {
|
||||||
if c.is_lowercase() {
|
char_value - LOWERCASE_A_SCORE + 1
|
||||||
char_value - LOWERCASE_A_SCORE + 1
|
} else {
|
||||||
} else {
|
char_value - UPPERCASE_A_SCORE + 27
|
||||||
char_value - UPPERCASE_A_SCORE + 27
|
}
|
||||||
}
|
})
|
||||||
})
|
.sum();
|
||||||
.sum();
|
|
||||||
|
|
||||||
println!("Part 1: sum of scores of all priority items: {}", sum_of_scored_priority_letters);
|
println!(
|
||||||
|
"Part 1: sum of scores of all priority items: {}",
|
||||||
|
sum_of_scored_priority_letters
|
||||||
|
);
|
||||||
|
|
||||||
let sum_of_badges: u32 =
|
let sum_of_badges: u32 = badges
|
||||||
badges
|
.iter()
|
||||||
.iter()
|
.map(|c| -> u32 {
|
||||||
.map(|c| -> u32 {
|
let char_value: u32 = (*c).into();
|
||||||
let char_value: u32 = (*c).into();
|
if c.is_lowercase() {
|
||||||
if c.is_lowercase() {
|
char_value - LOWERCASE_A_SCORE + 1
|
||||||
char_value - LOWERCASE_A_SCORE + 1
|
} else {
|
||||||
} else {
|
char_value - UPPERCASE_A_SCORE + 27
|
||||||
char_value - UPPERCASE_A_SCORE + 27
|
}
|
||||||
}
|
})
|
||||||
})
|
.sum();
|
||||||
.sum();
|
|
||||||
|
|
||||||
println!("Part 2: sum of badges: {}", sum_of_badges);
|
println!("Part 2: sum of badges: {}", sum_of_badges);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ use crate::file::line_reader_for_file;
|
||||||
struct RangeString(String);
|
struct RangeString(String);
|
||||||
|
|
||||||
impl From<&str> for RangeString {
|
impl From<&str> for RangeString {
|
||||||
fn from(s: &str) -> Self { RangeString(s.to_string()) }
|
fn from(s: &str) -> Self {
|
||||||
|
RangeString(s.to_string())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<RangeString> for RangeInclusive<u32> {
|
impl From<RangeString> for RangeInclusive<u32> {
|
||||||
|
@ -28,8 +30,8 @@ struct Assignment {
|
||||||
impl Assignment {
|
impl Assignment {
|
||||||
fn from_left_and_right_specifier(
|
fn from_left_and_right_specifier(
|
||||||
left_specifier: RangeString,
|
left_specifier: RangeString,
|
||||||
right_specifier: RangeString) -> Assignment
|
right_specifier: RangeString,
|
||||||
{
|
) -> Assignment {
|
||||||
Assignment {
|
Assignment {
|
||||||
left: RangeInclusive::<u32>::from(left_specifier),
|
left: RangeInclusive::<u32>::from(left_specifier),
|
||||||
right: RangeInclusive::<u32>::from(right_specifier),
|
right: RangeInclusive::<u32>::from(right_specifier),
|
||||||
|
@ -37,10 +39,10 @@ impl Assignment {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_range_contained_by_other(&self) -> bool {
|
fn has_range_contained_by_other(&self) -> bool {
|
||||||
let left_contains_right = self.left.contains(self.right.start())
|
let left_contains_right =
|
||||||
&& self.left.contains(self.right.end());
|
self.left.contains(self.right.start()) && self.left.contains(self.right.end());
|
||||||
let right_contains_left = self.right.contains(self.left.start())
|
let right_contains_left =
|
||||||
&& self.right.contains(self.left.end());
|
self.right.contains(self.left.start()) && self.right.contains(self.left.end());
|
||||||
|
|
||||||
left_contains_right || right_contains_left
|
left_contains_right || right_contains_left
|
||||||
}
|
}
|
||||||
|
@ -60,21 +62,33 @@ pub fn main(filename: &str) -> Result<()> {
|
||||||
let mut elves = line.split(",").map(|s| RangeString::from(s));
|
let mut elves = line.split(",").map(|s| RangeString::from(s));
|
||||||
let assignment = Assignment::from_left_and_right_specifier(
|
let assignment = Assignment::from_left_and_right_specifier(
|
||||||
elves.next().unwrap(),
|
elves.next().unwrap(),
|
||||||
elves.next().unwrap());
|
elves.next().unwrap(),
|
||||||
|
);
|
||||||
|
|
||||||
assert!(elves.next() == None);
|
assert!(elves.next() == None);
|
||||||
|
|
||||||
assignment
|
assignment
|
||||||
})
|
})
|
||||||
.fold((0, 0, 0), |acc, a| {
|
.fold((0, 0, 0), |acc, a| {
|
||||||
let part1_counter = acc.1 + if a.has_range_contained_by_other() { 1 } else { 0 };
|
let part1_counter = acc.1
|
||||||
|
+ if a.has_range_contained_by_other() {
|
||||||
|
1
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
};
|
||||||
let part2_counter = acc.2 + if a.has_overlapping_range() { 1 } else { 0 };
|
let part2_counter = acc.2 + if a.has_overlapping_range() { 1 } else { 0 };
|
||||||
(acc.0 + 1, part1_counter, part2_counter)
|
(acc.0 + 1, part1_counter, part2_counter)
|
||||||
});
|
});
|
||||||
|
|
||||||
println!("Processed {} assignments", assignment_counts.0);
|
println!("Processed {} assignments", assignment_counts.0);
|
||||||
println!("Part 1: number of assignments with one range containing the other: {}", assignment_counts.1);
|
println!(
|
||||||
println!("Part 2: number of assignments with ranges at least partially overlapping: {}", assignment_counts.2);
|
"Part 1: number of assignments with one range containing the other: {}",
|
||||||
|
assignment_counts.1
|
||||||
|
);
|
||||||
|
println!(
|
||||||
|
"Part 2: number of assignments with ranges at least partially overlapping: {}",
|
||||||
|
assignment_counts.2
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,17 @@ use crate::file::line_reader_for_file;
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq)]
|
||||||
enum State {
|
enum State {
|
||||||
StartingState,
|
StartingState,
|
||||||
Instructions
|
Instructions,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Stacks(Vec<Vec<String>>);
|
struct Stacks(Vec<Vec<String>>);
|
||||||
|
|
||||||
impl Stacks {
|
impl Stacks {
|
||||||
fn part1_perform(&mut self, instruction: &Instruction) -> std::result::Result<(), &'static str> {
|
fn part1_perform(
|
||||||
|
&mut self,
|
||||||
|
instruction: &Instruction,
|
||||||
|
) -> std::result::Result<(), &'static str> {
|
||||||
for _ in 0..instruction.quantity {
|
for _ in 0..instruction.quantity {
|
||||||
let item = self.0[instruction.from_stack].pop().unwrap();
|
let item = self.0[instruction.from_stack].pop().unwrap();
|
||||||
self.0[instruction.to_stack].push(item);
|
self.0[instruction.to_stack].push(item);
|
||||||
|
@ -21,7 +24,10 @@ impl Stacks {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn part2_perform(&mut self, instruction: &Instruction) -> std::result::Result<(), &'static str> {
|
fn part2_perform(
|
||||||
|
&mut self,
|
||||||
|
instruction: &Instruction,
|
||||||
|
) -> std::result::Result<(), &'static str> {
|
||||||
let from_stack_len: usize = self.0[instruction.from_stack].len();
|
let from_stack_len: usize = self.0[instruction.from_stack].len();
|
||||||
let index_of_last_n = from_stack_len - instruction.quantity;
|
let index_of_last_n = from_stack_len - instruction.quantity;
|
||||||
|
|
||||||
|
@ -40,10 +46,16 @@ impl Stacks {
|
||||||
|
|
||||||
impl fmt::Display for Stacks {
|
impl fmt::Display for Stacks {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "{}", self.0.iter().enumerate()
|
write!(
|
||||||
.map(|(i, v)| format!("{}: {}", i, v.join(", ")))
|
f,
|
||||||
.collect::<Vec<String>>()
|
"{}",
|
||||||
.join("\n"))
|
self.0
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
.map(|(i, v)| format!("{}: {}", i, v.join(", ")))
|
||||||
|
.collect::<Vec<String>>()
|
||||||
|
.join("\n")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +63,7 @@ impl fmt::Display for Stacks {
|
||||||
struct Instruction {
|
struct Instruction {
|
||||||
quantity: usize,
|
quantity: usize,
|
||||||
from_stack: usize,
|
from_stack: usize,
|
||||||
to_stack: usize
|
to_stack: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<&str> for Instruction {
|
impl TryFrom<&str> for Instruction {
|
||||||
|
@ -92,7 +104,7 @@ impl TryFrom<&str> for Instruction {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Instruction {
|
Ok(Instruction {
|
||||||
quantity: quantity,
|
quantity: quantity,
|
||||||
from_stack: from_stack,
|
from_stack: from_stack,
|
||||||
to_stack: to_stack,
|
to_stack: to_stack,
|
||||||
})
|
})
|
||||||
|
@ -132,19 +144,25 @@ pub fn main(filename: &str) -> Result<()> {
|
||||||
|
|
||||||
index_of_stack += 1;
|
index_of_stack += 1;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
State::Instructions => {
|
State::Instructions => {
|
||||||
let instruction = Instruction::try_from(line.as_str()).unwrap();
|
let instruction = Instruction::try_from(line.as_str()).unwrap();
|
||||||
let _ = part1_stacks.part1_perform(&instruction);
|
let _ = part1_stacks.part1_perform(&instruction);
|
||||||
let _ = part2_stacks.part2_perform(&instruction);
|
let _ = part2_stacks.part2_perform(&instruction);
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("{}", part1_stacks);
|
println!("{}", part1_stacks);
|
||||||
println!("Part 1: tops of stacks: {}", part1_stacks.tops().collect::<Vec<&str>>().join(""));
|
println!(
|
||||||
|
"Part 1: tops of stacks: {}",
|
||||||
|
part1_stacks.tops().collect::<Vec<&str>>().join("")
|
||||||
|
);
|
||||||
println!("{}", part2_stacks);
|
println!("{}", part2_stacks);
|
||||||
println!("Part 2: tops of stacks: {}", part2_stacks.tops().collect::<Vec<&str>>().join(""));
|
println!(
|
||||||
|
"Part 2: tops of stacks: {}",
|
||||||
|
part2_stacks.tops().collect::<Vec<&str>>().join("")
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::io::Lines;
|
||||||
use std::io::Result;
|
use std::io::Result;
|
||||||
|
|
||||||
pub fn line_reader_for_file(filename: &str) -> Result<Lines<BufReader<File>>> {
|
pub fn line_reader_for_file(filename: &str) -> Result<Lines<BufReader<File>>> {
|
||||||
let file = File::open(filename)?;
|
let file = File::open(filename)?;
|
||||||
let reader = BufReader::new(file);
|
let reader = BufReader::new(file);
|
||||||
Ok(reader.lines())
|
Ok(reader.lines())
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,26 +14,21 @@ fn main() {
|
||||||
|
|
||||||
println!("----- Day 1 -----");
|
println!("----- Day 1 -----");
|
||||||
let day1_datafile = &args[1];
|
let day1_datafile = &args[1];
|
||||||
day1::main(&day1_datafile)
|
day1::main(&day1_datafile).expect("Unable to process day1 data file");
|
||||||
.expect("Unable to process day1 data file");
|
|
||||||
|
|
||||||
println!("----- Day 2 -----");
|
println!("----- Day 2 -----");
|
||||||
let day2_datafile = &args[2];
|
let day2_datafile = &args[2];
|
||||||
day2::main(&day2_datafile)
|
day2::main(&day2_datafile).expect("Unable to process day2 data file");
|
||||||
.expect("Unable to process day2 data file");
|
|
||||||
|
|
||||||
println!("----- Day 3 -----");
|
println!("----- Day 3 -----");
|
||||||
let day3_datafile = &args[3];
|
let day3_datafile = &args[3];
|
||||||
day3::main(&day3_datafile)
|
day3::main(&day3_datafile).expect("Unable to process day3 data file");
|
||||||
.expect("Unable to process day3 data file");
|
|
||||||
|
|
||||||
println!("----- Day 4 -----");
|
println!("----- Day 4 -----");
|
||||||
let day4_datafile = &args[4];
|
let day4_datafile = &args[4];
|
||||||
day4::main(day4_datafile.as_str())
|
day4::main(day4_datafile.as_str()).expect("Unable to process day4 data file");
|
||||||
.expect("Unable to process day4 data file");
|
|
||||||
|
|
||||||
println!("----- Day 5 -----");
|
println!("----- Day 5 -----");
|
||||||
let day5_datafile = &args[5];
|
let day5_datafile = &args[5];
|
||||||
day5::main(day5_datafile.as_str())
|
day5::main(day5_datafile.as_str()).expect("Unable to process day5 data file");
|
||||||
.expect("Unable to process day5 data file");
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue