mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 21:30:31 +01:00
Implement 2023 day 13 part 1
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
//! Common helper utilities to all days
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use std::fmt;
|
||||
use std::fmt::Display;
|
||||
use std::ops::Add;
|
||||
use std::ops::Div;
|
||||
use std::ops::Index;
|
||||
@@ -292,3 +294,9 @@ impl<'a> Index<usize> for Grid<'a> {
|
||||
&self.data[offset..(offset + self.width())]
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Grid<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", String::from_utf8_lossy(self.data))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user