Skip to content

Commit

Permalink
#3 make input method
Browse files Browse the repository at this point in the history
  • Loading branch information
G-ONL committed Mar 23, 2019
1 parent cfa5033 commit 10733cb
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;


Expand Down Expand Up @@ -32,9 +35,22 @@ public static int[] createRandomNumber() {
return computerNumber;
}

public static int[] Input() {
public static int[] Input() throws IOException {
boolean valid = false;
String num = "";
while (!valid) {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.print("숫자를 입력해주세요 : ");
num = bf.readLine();
//valid = isValid(num); valid는 맨 뒤에서 구현 예정
valid = true; //우선은 정해진 값만 들어온다.
}
int[] userNumber = new int[3];
for (int i = 0; i < 3; i++) {
userNumber[i] = num.charAt(i) - '0';
}

return null;
return userNumber;
}

public static boolean playBaseball() {
Expand Down Expand Up @@ -65,7 +81,7 @@ public static boolean isRegame() {
return true;
}

public static boolean isValid(int[] inputNum) {
public static boolean isValid(String inputNum) {

return true;
}
Expand Down

0 comments on commit 10733cb

Please sign in to comment.