Skip to content

Commit

Permalink
Begin implementing Display for Board
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Jan 21, 2024
1 parent 56e43fa commit 1598367
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions day22/src/day22.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{
convert::{TryInto, TryFrom},
env,
fs,
fmt,
ops::{Add, Deref, DerefMut, RangeInclusive},
process,
str::FromStr,
Expand Down Expand Up @@ -33,6 +34,12 @@ struct Vec3 {
z: i32,
}

impl Vec3 {
fn min(self, rhs: Self) -> Self { x: self.x.min(rhs.x), y: self.y.min(rhs.y), z: self.z.min(rhs.z) }

fn max(self, rhs: Self) -> Self { x: self.x.max(rhs.x), y: self.y.max(rhs.y), z: self.z.max(rhs.z) }
}

impl Add<Vec3> for Vec3 {
type Output = Self;

Expand Down Expand Up @@ -121,6 +128,14 @@ struct Board {
}

impl Board {
fn min_bound(&self) -> Vec3 {
todo!()
}

fn max_bound(&self) -> Vec3 {
todo!()
}

fn collides(&self, brick: &Id<Brick>) -> bool {
self.bricks
.iter()
Expand All @@ -137,6 +152,12 @@ impl Board {
}
}

impl fmt::Display for Board {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result<()> {
todo!()
}
}

impl FromStr for Board {
type Err = String;

Expand Down

0 comments on commit 1598367

Please sign in to comment.