Advent of Code solutions
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add ipos! and upos! macros

Ben C 7ce848a2 aa0ed0d1

+9 -2
+9 -2
utils/src/pos.rs
··· 21 21 } 22 22 23 23 #[macro_export] 24 - macro_rules! mpos { 24 + macro_rules! ipos { 25 25 ($x:expr, $y:expr) => { 26 26 $crate::pos::Position::new($x, $y) 27 + }; 28 + } 29 + 30 + #[macro_export] 31 + macro_rules! upos { 32 + ($x:expr, $y:expr) => { 33 + $crate::pos::ipos!($x as isize, $y as isize) 27 34 }; 28 35 } 29 36 ··· 39 46 (@builtin SW) => { $crate::dir::ALL_8[6] }; 40 47 (@builtin NW) => { $crate::dir::ALL_8[7] }; 41 48 42 - (@builtin ($x:expr, $y: expr)) => { $crate::pos::pos!($x, $y) }; 49 + (@builtin ($x:expr, $y: expr)) => { $crate::pos::upos!($x, $y) }; 43 50 44 51 [$($s:tt),*] => { 45 52 [$(kern!(@builtin $s),)*]