Skip to main content

nearest_neighbour

Function nearest_neighbour 

Source
pub fn nearest_neighbour(
    size: usize,
    types: &[CellType],
    cell: i32,
    toward: i32,
    mask: u32,
) -> Option<i32>
Expand description

Of the 8 cells around cell whose type is in mask, the one nearest (squared cell distance) to toward; the first found wins ties (x outer, y inner).

Original: FUN_1400a21c0.