Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1단계 : 자바에서 랜덤값을 어떻게 생성하는지 알 수 있었습니다.
2단계 : 그동안 파이썬만 써와서 "파이썬에 있는 list comprehension과 lambda 함수같은 기능이 java에도 있다면 이를 이용해 indent를 줄여보자" 라고 생각을 했습니다. 찾아보니 java에는 stream이라는 것이 있었습니다. 공부를 해보고 나니 list comprehension보다 훨씬 범용성 있게 사용할 수 있겠다 싶었습니다.
3단계 : 처음에 질문을 잘못 이해해서 4 이상일 경우 나온 수만큼 전진하고, 3 이하일 경우 0칸 전진하는 것으로 잘못 이해해서 자동차의 이동 칸 수가 터미널을 뚫고 나갔습니다 ㅎ... 다행히 커밋하기 전에 알아차려서 고쳤습니다.
4단계 : 정보처리기사 필기를 공부하면서 MVC 패턴이라는 것을 기출에서 본 적이 있는데, 단순히 "사용자 입력을 view에서 처리하고 이를 받아 controller가 model을 조정한다" 라고만 알고 있었습니다. 이번 리펙터링을 통해 MVC 패턴에 대해 더 깊이 이해할 수 있었습니다. 다만, "neo : -----"와 같이 자동차가 몇 번 이동했는지 알려주는 텍스트는 view에서 처리해야 할 거 같은데, move()를 한번 시도한 뒤 이를 출력한다면 domain에서 view를 호출하게 되어 domain이 view에게 의존하는 문제가 발생할 것 같았습니다. 이 문제를 어떻게 해결해야 할 지 몰라서 Car 객체에 해당 부분을 주석처리한 상태로 놔두었습니다... 어떻게 처리하는 것이 좋을까요??