mirror of
https://github.com/LeMoonStar/AoC24.git
synced 2025-07-08 00:10:00 +02:00
🎨 Day 4: Formatting
This commit is contained in:
parent
11b61a2527
commit
bb4c059b25
1 changed files with 7 additions and 14 deletions
|
@ -13,7 +13,7 @@ enum Direction {
|
|||
NorthEast,
|
||||
NorthWest,
|
||||
SouthEast,
|
||||
SouthWest
|
||||
SouthWest,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -31,6 +31,7 @@ impl LetterWall {
|
|||
}
|
||||
|
||||
fn is_upper_left_of_xmas(&self, x: usize, y: usize) -> Option<Direction> {
|
||||
#[rustfmt::skip]
|
||||
match(
|
||||
self.at( x, y), self.at( x+1, y), self.at( x+2, y), self.at( x+3, y),
|
||||
self.at( x, y+1), self.at( x+1, y+1), self.at( x+2, y+1), self.at( x+3, y+1),
|
||||
|
@ -105,12 +106,7 @@ impl LetterWall {
|
|||
|
||||
impl From<&str> for LetterWall {
|
||||
fn from(value: &str) -> Self {
|
||||
Self (
|
||||
value
|
||||
.lines()
|
||||
.map(|v| v.chars().collect())
|
||||
.collect()
|
||||
)
|
||||
Self(value.lines().map(|v| v.chars().collect()).collect())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,10 +122,7 @@ impl DayImpl<Data> for Day<CURRENT_DAY> {
|
|||
}
|
||||
|
||||
fn init(input: &str) -> (Self, Data) {
|
||||
(
|
||||
Self {},
|
||||
input.into(),
|
||||
)
|
||||
(Self {}, input.into())
|
||||
}
|
||||
|
||||
fn one(&self, data: &mut Data) -> Answer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue