소스 검색

Stupid mistake

Piotr Czajkowski 1 년 전
부모
커밋
a57217280c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      23/code.go

+ 1 - 1
23/code.go

@@ -106,7 +106,7 @@ func (p *Point) getDestinations(board [][]byte, height int, width int) []Point {
 		destinations = append(destinations, Point{y: p.y - 1, x: p.x, steps: p.steps})
 	}
 
-	if p.y+1 >= 0 && board[p.y+1][p.x] != Rock {
+	if p.y+1 < height && board[p.y+1][p.x] != Rock {
 		destinations = append(destinations, Point{y: p.y + 1, x: p.x, steps: p.steps})
 	}