Skip to content
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

[둘리] 2단계 자동차 경주 제출합니다. #68

Merged
merged 12 commits into from
Feb 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(RaceGame): 간접 호출 삭제
  • Loading branch information
hyemdooly committed Feb 13, 2023
commit e37d339128babcd862ccf223b3c3e85c085cf802
7 changes: 2 additions & 5 deletions src/main/kotlin/controller/RaceGame.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class RaceGame(private val outputView: OutputView, private val inputView: InputV

fun run() {
outputView.outputCarNames()
val cars = executeInputCarNames()
val cars = Cars(inputView.inputCarNames())
outputView.outputTryNumber()
val tryNumber = executeInputTryNumber()
val tryNumber = inputView.inputTryNumber().toInt()
outputView.outputResults()
repeat(tryNumber) {
tryMove(cars)
Expand All @@ -26,7 +26,4 @@ class RaceGame(private val outputView: OutputView, private val inputView: InputV
}
outputView.outputNextLine()
}

private fun executeInputTryNumber(): Int = inputView.inputTryNumber().toInt()
private fun executeInputCarNames(): Cars = Cars(inputView.inputCarNames())
}