Updated dependencies.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user