diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..23baf58
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# 디폴트 무시된 파일
+/shelf/
+/workspace.xml
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..6345415
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..f5a0c5d
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/java-racing-car.iml b/.idea/java-racing-car.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/java-racing-car.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..6996d7a
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..83a9ab3
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..797acea
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/amaran-th/.gitignore b/amaran-th/.gitignore
new file mode 100644
index 0000000..76611b0
--- /dev/null
+++ b/amaran-th/.gitignore
@@ -0,0 +1,21 @@
+.DS_Store
+.gradle
+/build/
+!gradle/wrapper/gradle-wrapper.jar
+/out/
+/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+bin/
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
\ No newline at end of file
diff --git a/amaran-th/LICENSE b/amaran-th/LICENSE
new file mode 100644
index 0000000..2e82af5
--- /dev/null
+++ b/amaran-th/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020 woowacourse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/amaran-th/README.md b/amaran-th/README.md
new file mode 100644
index 0000000..85c62b2
--- /dev/null
+++ b/amaran-th/README.md
@@ -0,0 +1,43 @@
+### 기능 요구 사항
+
+- [x] 주어진 횟수동안 n대의 자동차는 전진 또는 멈출 수 있다.
+- [x] 각 자동차에 이름을 부여할 수 있다. 전진하는 자동차를 출력할 때 자동차 이름을 같이 출력한다.
+- [x] 자동차 이름은 쉼표(,)를 기준으로 구분하며 이름은 5자 이하만 가능하다.
+- [x] 사용자는 몇 번의 이동을 할 것인지를 입력할 수 있어야 한다.
+- [x] 전진하는 조건은 0에서 9 사이에서 무작위 값을 구한 후 무작위 값이 4 이상일 경우이다.
+- [x] 자동차 경주 게임을 완료한 후 누가 우승했는지를 알려준다. 우승자는 한 명 이상일 수 있다.
+- [x] 우승자가 여러 명일 경우 쉼표(,)를 이용하여 구분한다.
+- [x] 사용자가 잘못된 값을 입력할 경우 IllegalArgumentException를 발생시키고, "[ERROR]"로 시작하는 에러 메시지를 출력 후 그 부분부터 입력을 다시
+ 받는다.
+- [x] 아래의 프로그래밍 실행 결과 예시와 동일하게 입력과 출력이 이루어져야 한다.
+
+### 입출력 요구사항
+
+- 입력
+ - [x] 경주할 자동차 이름(이름은 쉼표를 기준으로 구분)
+ - [x] 시도할 횟수
+- 출력
+ - [x] 각 차수별 실행 결과
+
+ pobi : ---
+
+ woni : ---
+
+ jun : ---
+ - [x] 단독 우승자 안내 문구>> 최종 우승자 : pobi
+ - [x] 공동 우승자 안내 문구>> 최종 우승자 : pobi, jun
+ - [x] 예외 상황 시 에러문구를 출력해야 한다.>> [ERROR] 시도 횟수는 숫자여야 한다.
+
+### 프로그래밍 요구사항
+
+- indent depth를 3이 넘지 않도록 구현(2까지 허용)
+- 3항 연산자를 쓰지 않는다.
+- 함수가 한 가지 일만 하도록 최대한 작게 만든다.
+- 함수의 길이가 15라인을 넘어가지 않도록 구현한다.
+- else 예약어를 쓰지 않는다.(switch/case도 마찬가지)
+
+### Car 객체 프로그래밍 요구사항
+
+- Car 기본 생성자를 추가할 수 없다.
+- name, position 변수의 접근 제어자인 private를 변경할 수 없다.
+- 가능하면 setPosition 메소드를 추가하지 않고 구현한다.
diff --git a/amaran-th/build.gradle b/amaran-th/build.gradle
new file mode 100644
index 0000000..45d6169
--- /dev/null
+++ b/amaran-th/build.gradle
@@ -0,0 +1,23 @@
+apply plugin: 'java'
+apply plugin: 'eclipse'
+
+version = '1.0.0'
+
+repositories {
+ maven { url 'https://jitpack.io' }
+ mavenCentral()
+}
+
+dependencies {
+ implementation('com.github.woowacourse-projects:mission-utils:1.0.0')
+}
+
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(8)
+ }
+}
+
+test {
+ useJUnitPlatform()
+}
diff --git a/amaran-th/gradle.properties b/amaran-th/gradle.properties
new file mode 100644
index 0000000..16e868e
--- /dev/null
+++ b/amaran-th/gradle.properties
@@ -0,0 +1,2 @@
+org.gradle.jvmargs=-Dfile.encoding=UTF-8
+org.gradle.console=plain
diff --git a/amaran-th/gradle/wrapper/gradle-wrapper.jar b/amaran-th/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..87b738c
Binary files /dev/null and b/amaran-th/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/amaran-th/gradle/wrapper/gradle-wrapper.properties b/amaran-th/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..28ff446
--- /dev/null
+++ b/amaran-th/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/amaran-th/gradlew b/amaran-th/gradlew
new file mode 100644
index 0000000..af6708f
--- /dev/null
+++ b/amaran-th/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/amaran-th/gradlew.bat b/amaran-th/gradlew.bat
new file mode 100644
index 0000000..6d57edc
--- /dev/null
+++ b/amaran-th/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/amaran-th/src/main/java/racingcar/Application.java b/amaran-th/src/main/java/racingcar/Application.java
new file mode 100644
index 0000000..0e3c75c
--- /dev/null
+++ b/amaran-th/src/main/java/racingcar/Application.java
@@ -0,0 +1,11 @@
+package racingcar;
+
+import racingcar.gameController.GameController;
+
+public class Application {
+
+ public static void main(String[] args) {
+ GameController gameController = new GameController();
+ gameController.gameStart();
+ }
+}
diff --git a/amaran-th/src/main/java/racingcar/Car.java b/amaran-th/src/main/java/racingcar/Car.java
new file mode 100644
index 0000000..95b6c9b
--- /dev/null
+++ b/amaran-th/src/main/java/racingcar/Car.java
@@ -0,0 +1,27 @@
+package racingcar;
+
+public class Car {
+
+ private final String name;
+ private int position = 0;
+
+ public Car(String name) {
+ this.name = name;
+ }
+
+ // 추가 기능 구현
+ public String getName() {
+ return name;
+ }
+
+ public int getPosition() {
+ return position;
+ }
+
+ public void behave(boolean isGo) {
+ if (isGo) {
+ position++;
+ }
+ }
+
+}
diff --git a/amaran-th/src/main/java/racingcar/gameController/GameController.java b/amaran-th/src/main/java/racingcar/gameController/GameController.java
new file mode 100644
index 0000000..6dac9d9
--- /dev/null
+++ b/amaran-th/src/main/java/racingcar/gameController/GameController.java
@@ -0,0 +1,70 @@
+package racingcar.gameController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+import racingcar.Car;
+import racingcar.tool.RacingTool;
+import racingcar.tool.TextPrinter;
+import racingcar.tool.TextScanner;
+
+public class GameController {
+
+ TextPrinter textPrinter = new TextPrinter();
+ TextScanner textScanner = new TextScanner();
+ RacingTool racingTool = new RacingTool();
+ List carList = new ArrayList();
+ List winnerList = new ArrayList();
+ int roundN = 0;
+
+ public void gameStart() {
+ try {
+ //초기설정
+ textPrinter.printInit();
+ setCarList(textScanner.scanCarName());
+ textPrinter.printQuestion();
+ setRoundN(textScanner.scanRoundN());
+ //라운드 실행
+ runRounds();
+ //우승자 출력
+ pickWinners();
+ textPrinter.printWinner(winnerList);
+ } catch (IllegalArgumentException e) {
+ TextPrinter.printError(e);
+ }
+ }
+
+ public void setRoundN(int roundN) {
+ this.roundN = roundN;
+ }
+
+ public void setCarList(String[] carNameList) {
+ Arrays.stream(carNameList).map((carName) -> carList.add(new Car(carName)))
+ .collect(Collectors.toList());
+
+ }
+
+ public void runRounds() {
+ for (int i = 0; i < roundN; i++) {
+ runRound();
+ }
+ }
+
+ public void runRound() {
+ for (int i = 0; i < carList.size(); i++) {
+ carList.get(i).behave(racingTool.isGoAhead());
+ }
+ textPrinter.printRound(carList);
+ }
+
+ public void pickWinners() {
+ int maxPosition = getMaxPosition();
+ winnerList = carList.stream().filter(car -> car.getPosition() == maxPosition)
+ .map(car -> car.getName()).collect(Collectors.toList());
+ }
+
+ public int getMaxPosition() {
+ return carList.stream().mapToInt(car -> car.getPosition()).max().getAsInt();
+ }
+}
diff --git a/amaran-th/src/main/java/racingcar/tool/RacingTool.java b/amaran-th/src/main/java/racingcar/tool/RacingTool.java
new file mode 100644
index 0000000..9cd8cb3
--- /dev/null
+++ b/amaran-th/src/main/java/racingcar/tool/RacingTool.java
@@ -0,0 +1,31 @@
+package racingcar.tool;
+
+import camp.nextstep.edu.missionutils.Randoms;
+
+public class RacingTool {
+
+ public boolean isGoAhead() { //전진할 지 여부를 반환하는 메서드
+ int random = Randoms.pickNumberInRange(0, 9);
+ return random >= 4;
+ }
+
+ public static void checkName(String[] names) throws IllegalArgumentException {
+ for (int i = 0; i < names.length; i++) {
+ if (names[i].length() > 5) {
+ throw new IllegalArgumentException("이름은 다섯 글자를 넘길 수 없다.");
+ }
+ }
+ }
+
+ public static int checkRoundN(String input) throws IllegalArgumentException {
+ if (!input.matches("^[0-9]+$")) {
+ throw new IllegalArgumentException("시도 횟수는 숫자여야 한다.");
+ }
+ int roundN = Integer.parseInt(input);
+ if (roundN <= 0) {
+ throw new IllegalArgumentException("시도 횟수는 양수여야 한다.");
+ }
+ return roundN;
+
+ }
+}
diff --git a/amaran-th/src/main/java/racingcar/tool/TextPrinter.java b/amaran-th/src/main/java/racingcar/tool/TextPrinter.java
new file mode 100644
index 0000000..8cc1ed6
--- /dev/null
+++ b/amaran-th/src/main/java/racingcar/tool/TextPrinter.java
@@ -0,0 +1,39 @@
+package racingcar.tool;
+
+import java.util.List;
+import racingcar.Car;
+
+public class TextPrinter {
+
+ public void printInit() {
+ System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)");
+ }
+
+ public void printQuestion() {
+ System.out.println("시도할 횟수는 몇회인가요?");
+ }
+
+ public void printRound(List cars) {
+ for (int i = 0; i < cars.size(); i++) {
+ System.out.print(cars.get(i).getName() + " : ");
+ printPosition(cars.get(i).getPosition());
+ System.out.println();
+ }
+ System.out.println();
+ }
+
+ public void printPosition(int pos) {
+ for (int i = 0; i < pos; i++) {
+ System.out.print("-");
+ }
+ }
+
+ public void printWinner(List winnerList) {
+ System.out.println("최종 우승자 : " + String.join(", ", winnerList));
+ }
+
+ public static void printError(IllegalArgumentException e) {
+ System.out.println("[ERROR] " + e.getMessage());
+
+ }
+}
diff --git a/amaran-th/src/main/java/racingcar/tool/TextScanner.java b/amaran-th/src/main/java/racingcar/tool/TextScanner.java
new file mode 100644
index 0000000..5a0f580
--- /dev/null
+++ b/amaran-th/src/main/java/racingcar/tool/TextScanner.java
@@ -0,0 +1,32 @@
+package racingcar.tool;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class TextScanner {
+
+ public String[] scanCarName() {
+ String carNames = Console.readLine();
+ String[] carNameList = carNames.split(",");
+ try {
+ RacingTool.checkName(carNameList);
+ return carNameList;
+ } catch (IllegalArgumentException e) {
+ TextPrinter.printError(e);
+ return scanCarName();
+ }
+
+ }
+
+ public int scanRoundN() {
+ String input = Console.readLine();
+ try {
+ int roundN = RacingTool.checkRoundN(input);
+ return roundN;
+ } catch (IllegalArgumentException e) {
+ TextPrinter.printError(e);
+ return scanRoundN();
+ }
+ }
+
+
+}
diff --git a/amaran-th/src/test/java/racingcar/ApplicationTest.java b/amaran-th/src/test/java/racingcar/ApplicationTest.java
new file mode 100644
index 0000000..8f6f70a
--- /dev/null
+++ b/amaran-th/src/test/java/racingcar/ApplicationTest.java
@@ -0,0 +1,41 @@
+package racingcar;
+
+import camp.nextstep.edu.missionutils.test.NsTest;
+import org.junit.jupiter.api.Test;
+
+import static camp.nextstep.edu.missionutils.test.Assertions.assertRandomNumberInRangeTest;
+import static camp.nextstep.edu.missionutils.test.Assertions.assertSimpleTest;
+import static org.assertj.core.api.Assertions.assertThat;
+
+class ApplicationTest extends NsTest {
+ private static final int MOVING_FORWARD = 4;
+ private static final int STOP = 3;
+
+ private static final String ERROR_MESSAGE = "[ERROR]";
+
+ @Test
+ void 전진_정지() {
+ assertRandomNumberInRangeTest(
+ () -> {
+ run("pobi,woni", "1");
+ assertThat(output()).contains("pobi : -", "woni : ", "최종 우승자 : pobi");
+ },
+ MOVING_FORWARD, STOP
+ );
+ }
+
+ @Test
+ void 이름에_대한_예외_처리() {
+ assertSimpleTest(
+ () -> {
+ runException("pobi,javaji");
+ assertThat(output()).contains(ERROR_MESSAGE);
+ }
+ );
+ }
+
+ @Override
+ public void runMain() {
+ Application.main(new String[]{});
+ }
+}