-
Notifications
You must be signed in to change notification settings - Fork 60
[BCSD Lab] 임아리 4차시 미션 제출합니다. #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7b1a3c7
초기 설정
dldb-chamchi 418e4f6
feat: Line 생성
dldb-chamchi 38f0433
feat: Player 생성
dldb-chamchi a206dfd
feat: Ladder 생성
dldb-chamchi bae2eca
feat: LadderResult 생성
dldb-chamchi c74c95e
feat: InputView 생성
dldb-chamchi 354f100
feat: ResultView 생성
dldb-chamchi d67337f
feat: LadderController 생성
dldb-chamchi 2c31d32
feat: Main 생성
dldb-chamchi 10d8e7a
feat: 테스트 생성
dldb-chamchi 964b120
Merge branch 'dldb-chamchi' into step2
dldb-chamchi f1a4916
refactor: 매직넘버 상수화
dldb-chamchi 5c7da67
refactor: 에러메세지도 테스트
dldb-chamchi a317f47
style: 컨벤션 수정
dldb-chamchi ec039b5
feat: 에러 메세지 관리
dldb-chamchi 2d68f6c
refactor: 에러 메세지 관리 리팩터링
dldb-chamchi 6d01fb9
style: this 삭제
dldb-chamchi a2a2f88
refactor: 일급 컬렉션 적용
dldb-chamchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package view; | ||
|
|
||
| import java.util.*; | ||
|
|
||
| public class InputView { | ||
| private static final Scanner scanner = new Scanner(System.in); | ||
|
|
||
| public static List<String> getPlayerNames() { | ||
| System.out.println("참여할 사람 이름을 입력하세요. (이름은 쉼표(,)로 구분하세요)"); | ||
| return Arrays.asList(scanner.nextLine().split(",")); | ||
| } | ||
|
|
||
| public static List<String> getResults() { | ||
| System.out.println("실행 결과를 입력하세요. (결과는 쉼표(,)로 구분하세요)"); | ||
| return Arrays.asList(scanner.nextLine().split(",")); | ||
| } | ||
|
|
||
| public static int getLadderHeight() { | ||
| System.out.println("최대 사다리 높이는 몇 개인가요?"); | ||
| return scanner.nextInt(); | ||
| } | ||
|
|
||
| public static String getQuery() { | ||
| System.out.println("결과를 보고 싶은 사람은?"); | ||
| return scanner.next(); | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오....!!!
nextInt()를 하면 개행 문자가 버퍼에 남아있는 문제가 있어서 다음에nextLine()호출 시 바로 개행 문자가 입력되는 문제가 있었는데next()를 쓰면 개행 문자를 포함하지 않는군요.좋은 정보 하나 알아갑니다!! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 맞습니다 ㅎㅎ 김상진 교수님의 자바프로그래밍에서 배웠습니다! 도움이 되었다니 기쁩니다!