Implement 2022 day 15 part 2

This commit is contained in:
2022-12-16 08:28:06 +01:00
parent 0f64ec4e8f
commit 84110350ff
2 changed files with 83 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
use std::cmp::Ordering;
use std::ops::Add;
use std::ops::Div;
use std::ops::Index;
use std::ops::IndexMut;
use std::ops::Sub;
@@ -202,6 +203,14 @@ impl Sub<Self> for Vec2 {
}
}
impl Div<i32> for Vec2 {
type Output = Self;
fn div(self, rhs: i32) -> Self::Output {
Self(self.0.map(|v| v / rhs))
}
}
impl Index<usize> for Vec2 {
type Output = i32;