grid: use coord2d more consistently
This commit is contained in:
@ -42,9 +42,9 @@ impl AntennaMap {
|
||||
// permutations generates both pairs, ie. ((1,2),(2,1)) and ((2,1),(1,2)) so we don't need
|
||||
// to consider the 'negative' side of the line, which will be generated by the other pair
|
||||
let (a, b) = (pair[0], pair[1]);
|
||||
let offset = (a.0 - b.0, a.1 - b.1);
|
||||
let offset = (a.x - b.x, a.y - b.y);
|
||||
for i in (start..).map_while(|i| if Some(i - start) != reps { Some(i as i64) } else { None }) {
|
||||
let node_pos = (a.0 + i * offset.0, a.1 + i * offset.1);
|
||||
let node_pos = (a.x + i * offset.0, a.y + i * offset.1);
|
||||
if antinodes.set(&node_pos, true).is_none() {
|
||||
// left the grid
|
||||
break;
|
||||
|
Reference in New Issue
Block a user