1
0
Fork 0

Solve 12.1

This commit is contained in:
Lars Martens 2024-12-12 21:30:15 +01:00
parent 700fe510c2
commit 1f49f71068
Signed by: haselkern
GPG key ID: B5CF1F363C179AD4
4 changed files with 118 additions and 22 deletions

View file

@ -1,5 +1,6 @@
//! This library contains useful helper functions that may be useful in several problems.
use glam::IVec2;
use std::{
fmt::{Debug, Display},
ops::{Div, Mul, Rem},
@ -106,3 +107,23 @@ macro_rules! assert_example {
)
};
}
/// 4 directions. Start pointing right and go CCW.
pub const DIRECTIONS4: [IVec2; 4] = [
IVec2::new(1, 0),
IVec2::new(0, 1),
IVec2::new(-1, 0),
IVec2::new(0, -1),
];
/// 8 directions. Start pointing right and go CCW.
pub const DIRECTIONS8: [IVec2; 8] = [
IVec2::new(1, 0),
IVec2::new(1, 1),
IVec2::new(0, 1),
IVec2::new(-1, 1),
IVec2::new(-1, 0),
IVec2::new(-1, -1),
IVec2::new(0, -1),
IVec2::new(1, -1),
];