Updated dependencies.

This commit is contained in:
2023-11-12 12:36:02 +01:00
parent f472ace665
commit c4ae25d579
3 changed files with 252 additions and 103 deletions

View File

@@ -31,23 +31,6 @@ struct STP(i32, i32, i32, i32);
impl STP {}
impl STP {
fn neighbors(&self) -> Vec<Self> {
let mut result = Vec::new();
for x in -3..=3 {
for y in -3..=3 {
for z in -3..=3 {
for t in -3..=3 {
let candidate = STP(self.0 + x, self.1 + y, self.2 + z, self.3 + t);
if self.is_neighbor_to(&candidate) {
result.push(candidate);
}
}
}
}
}
result
}
fn distance(&self, other: &Self) -> u32 {
((self.0 - other.0).abs()
+ (self.1 - other.1).abs()
@@ -73,6 +56,7 @@ impl From<&str> for STP {
}
}
#[cfg(test)]
mod test {
use crate::tasks::day25::solve;