Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cfb9edf

Browse files
Update 게임-멥-최단거리.js
* 주석(레포 주소) 수정 * 함수 이름 변경 - isRoad -> isOut
1 parent e198e88 commit cfb9edf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎level-2/게임-맵-최단거리.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// https://programmers.co.kr/learn/courses/30/lessons/1844
1+
// https://github.com/codeisneverodd/programmers-coding-test
22
//정답 1 - prove-ability
33
function solution(maps) {
44
// BFS 활용
@@ -18,7 +18,7 @@ function solution(maps) {
1818
// 다음 길 위치
1919
const nextY = dy + y, nextX = dx + x;
2020
// 맵 밖으로 나간다면
21-
if(isRoad(nextY, nextX, row, col)) continue;
21+
if(isOut(nextY, nextX, row, col)) continue;
2222
// 도착한 곳이 벽이라면
2323
if(maps[nextY][nextX] === 0) continue;
2424
// 이미 지난 곳 벽으로 만들어서 다음에 접근 방지
@@ -37,4 +37,4 @@ function solution(maps) {
3737
const DIRECTION = [[1, 0], [0, 1], [-1, 0], [0, -1]];
3838

3939
// 사용이 가능한 길인지 확인하는 함수
40-
const isRoad = (nextY, nextX, row, col) => nextY < 0 || nextX < 0 || nextY > row || nextX > col;
40+
const isOut = (nextY, nextX, row, col) => nextY < 0 || nextX < 0 || nextY > row || nextX > col;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /