-
Notifications
You must be signed in to change notification settings - Fork 35
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
Pako 워들제출합니다. #4
Open
etff
wants to merge
55
commits into
woowahan-pjs:main
Choose a base branch
from
etff:pako
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
5d8479e
doc: 기능 명세서 추가
SGKIM94 eb31a9d
feat: Word에 대한 기능명세서의 테스트 코드 추가 및 클래스 추가
SGKIM94 f2afbd3
refactor: 불필요한 gitkeep 파일 제거
SGKIM94 5bab906
doc: 구현한 기능에 대한 체크 추가
SGKIM94 58b435b
refactor: klint에 대한 컨벤션 적용
SGKIM94 35852c3
feat: 타일에 대한 기능 명세서 구현 및 테스트 코드 추가
SGKIM94 6fde073
doc: 구현한 기능에 대한 체크 추가
SGKIM94 3bb8164
refactor: klint 에 대한 컨벤션 적용
SGKIM94 6fc2288
refactor: 단어를 비교하여 타일을 전달하는 WordMatcher 추가 및 테스트코드 추가
SGKIM94 991380a
refactor: Word 내 인덱스 위치에 단어가 존재하는지 찾는 foundAlphabet 함수 및 테스트코드 추가
SGKIM94 7369f19
refactor: 매직넘버에 대한 상수 추출
SGKIM94 51876df
doc: 기능 명세를 새로 추가함에 따른 수정
SGKIM94 7bba0b9
feat: 매칭에 대한 노란색과 회색이 되는 케이스에 대한 로직 및 테스트코드 추가
SGKIM94 3d994bf
feat: Word 에 알파벳이 포함되는 지에 대한 함수 및 테스트코드 추가
SGKIM94 050f619
doc: 매칭에 대해 구현한 기능 체크리스트 추가
SGKIM94 de730f8
feat: 게임을 승리하는 규칙과 실패하는 규칙에 대한 기능 및 테스트코드 추가
SGKIM94 d9546f3
feat: 시도횟수에 대한 value object 추출 진행
SGKIM94 3bb172b
refactor: 불필요한 예외 명시 제거 및 private 접근제어자 추가
SGKIM94 ced063d
doc: 구현된 기능에 대한 명세서 체크리스트 추가
SGKIM94 759013e
refactor: foundAlphabet -> findAlphabet 변경 및 메서드 추출 진행
SGKIM94 1d39fa9
refactor: private 접근제어자 추가
SGKIM94 eb71087
refactor: 가독성을 위한 until로 변경
SGKIM94 cbf8f74
feat: junit test import 추가
SGKIM94 8e52fd5
refactor: answer 에 대한 중복된 파라미터로 인해 멤버변수로 전환
SGKIM94 0a32d12
refactor: 게임 결과에 대해서 타일들을 전달하기 위한 요구사항 구현 및 테스트 코드 추가
SGKIM94 b06d616
feat: Tiles value object 추가 및 테스트코드 추가
SGKIM94 79f9e49
refactor: Tiles 추가에 따른 수정
SGKIM94 c4263dd
refactor: 불필요한 tryCount 제거
SGKIM94 21a5791
feat: words.txt 의 정답들을 가지는 Answers 추가
SGKIM94 1d526cd
feat: 입력을 받기 위한 InputView 추가
SGKIM94 1f4a332
refactor: 결과를 출력하기 위한 resultView 추가
SGKIM94 ad3d1b5
feat: 게임을 플레이하기 위한 기능 구현
SGKIM94 6783141
doc: 구현된 기능에 대한 체크리스트 추가
SGKIM94 5319a1a
refactor: 불필요한 함수 제거
SGKIM94 6d6d054
refactor: data 를 value class 로 변경
SGKIM94 e4dfdf0
refactor: 불필요한 선언 제거
SGKIM94 4ee303d
refactor: MAX_TRY_COUNT 에 대한 상수 추출
SGKIM94 6cc86be
refactor: List 로 사용할 수 있도록 선언
SGKIM94 beb1b18
refactor: 타일을 뷰와 분리하기 위한 viewTiles 추가
SGKIM94 2494155
refactor: 결과에 대한 멘트 수저
SGKIM94 605b476
refactor: Words 일급 컬렉션 추가
SGKIM94 dd9930b
refactor: 코틀린 함수 사용하도록 수정
SGKIM94 828fb34
refactor: 조건문을 간결하게 하도록 수정 및 불필요한 delicate 제거
SGKIM94 155f16a
refactor: delicate 제거에 따른 수정
SGKIM94 72ebdb8
feat: 결과물을 만들어내기 위한 Results 클래스 추가 및 테스트 코드 추가
SGKIM94 f57b1e5
refactor: word 를 매번 생성가능하도록 수정 및 2021.6.19에 대한 상수 추출
SGKIM94 64f24a9
refactor: klint
SGKIM94 5bce301
refactor: readlin() 으로 변경
SGKIM94 e544c0f
refactor: results를 ResultView 에서 가져다 사용하도록 수정
SGKIM94 c0633eb
refactor: mutableList 제거하기 위한 불변형태로 수정
SGKIM94 7e67435
refactor: Words 일급컬렉션 추가에 따른 수정 및 테스트코드 추가
SGKIM94 842c92e
refactor: kotlin extension 함수로 변겨
SGKIM94 0fcd81e
refactor: 불필요한 println 제거
SGKIM94 293c4b6
refactor: 코드 리뷰 반영 및 변경 필요한 부분 추가
SGKIM94 c40742d
refactor: 주석 삭제
etff 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 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,46 @@ | ||
package wordle.controller | ||
|
||
import wordle.domain.Answers | ||
import wordle.domain.Game | ||
import wordle.domain.Tiles | ||
import wordle.domain.Word | ||
import wordle.view.InputView | ||
import wordle.view.ResultView | ||
import java.io.File | ||
|
||
private const val START_PLAY_COUNT = 1 | ||
private const val LAST_PLAY_COUNT = 7 | ||
|
||
fun main() { | ||
val game = Game(Answers.ANSWER) | ||
|
||
ResultView.printInit() | ||
|
||
val results = mutableListOf<Tiles>() | ||
playGame(game, results) | ||
} | ||
|
||
private fun playGame(game: Game, results: MutableList<Tiles>) { | ||
(START_PLAY_COUNT until LAST_PLAY_COUNT).forEachIndexed { _, index -> | ||
val inputWord = InputView.askWord(Answers.WORDS) | ||
|
||
val resultTiles = game.play(Word(inputWord)) | ||
|
||
results.add(resultTiles) | ||
|
||
ResultView.printAllResults(results) | ||
|
||
checkIsWinner(game, resultTiles, index) | ||
} | ||
} | ||
|
||
private fun checkIsWinner(game: Game, resultTiles: Tiles, index: Int) { | ||
if (game.isWinner(resultTiles)) { | ||
ResultView.printGamePlayCount(index) | ||
throw IllegalStateException("게임이 종료되었습니다.") | ||
} | ||
} | ||
|
||
fun getResourceText(path: String): File { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이곳에 있어야만 하는 메서드인가요? |
||
return File(ClassLoader.getSystemResource(path).file) | ||
} |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package wordle.domain | ||
|
||
enum class Tile(val value: String) { | ||
YELLOW("\uD83D\uDFE7"), | ||
YELLOW("\uD83D\uDFE8"), | ||
GREEN("\uD83D\uDFE9"), | ||
GRAY("\uD83D\uDFE8"); | ||
GRAY("⬜"); | ||
} |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -21,5 +21,4 @@ class TilesTest { | |
|
||
assertThat(actual).isFalse | ||
} | ||
|
||
} |
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.
정상적으로 게임이 종료되는 것을 exception으로 구현하는 것은 어색한것 같습니다.