获取一个连续位置的矩阵中,特定位置相邻的最多四个方向的位置时,下方向位置错误修复

This commit is contained in:
kercylan98 2023-06-09 18:39:32 +08:00
parent 100a4e5f2d
commit 04d9b14896
1 changed files with 1 additions and 1 deletions

View File

@ -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)