获取一个连续位置的矩阵中,特定位置相邻的最多四个方向的位置时,下方向位置错误修复
This commit is contained in:
parent
100a4e5f2d
commit
04d9b14896
|
@ -40,7 +40,7 @@ func GetAdjacentPositionsWithContinuousPosition[T any](matrix []T, width, pos in
|
||||||
result = append(result, up)
|
result = append(result, up)
|
||||||
}
|
}
|
||||||
if down := pos + width; down < size {
|
if down := pos + width; down < size {
|
||||||
result = append(result, size)
|
result = append(result, down)
|
||||||
}
|
}
|
||||||
if left := pos - 1; pos >= 0 {
|
if left := pos - 1; pos >= 0 {
|
||||||
result = append(result, left)
|
result = append(result, left)
|
||||||
|
|
Loading…
Reference in New Issue