MCPcopy Create free account
hub / github.com/Notgnoshi/generative / neighbor

Function neighbor

tools/bitwise.rs:140–151  ·  view source on GitHub ↗
(x: i64, y: i64, n: Neighbor)

Source from the content-addressed store, hash-verified

138}
139
140fn neighbor(x: i64, y: i64, n: Neighbor) -> (i64, i64) {
141 match n {
142 Neighbor::North => (x, y - 1),
143 Neighbor::NorthEast => (x + 1, y - 1),
144 Neighbor::East => (x + 1, y),
145 Neighbor::SouthEast => (x + 1, y + 1),
146 Neighbor::South => (x, y + 1),
147 Neighbor::SouthWest => (x - 1, y + 1),
148 Neighbor::West => (x - 1, y),
149 Neighbor::NorthWest => (x - 1, y - 1),
150 }
151}
152
153fn main() -> eyre::Result<()> {
154 color_eyre::install()?;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected