-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunGame.java
More file actions
40 lines (31 loc) · 824 Bytes
/
runGame.java
File metadata and controls
40 lines (31 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package pa2자바실;
import java.util.Scanner;
import java.io.IOException;
public class runGame {
static Board game;
static boolean withFile;
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
String str;
while(true) {
System.out.println("Game with file? [Y/N]");
str = scan.nextLine();//이게 중요할 것 같음 다음입력값을 갱신하려면 이거를 board.java에서 계속해서 갱신해야하지않을까?
if(str.equals("Y")) {
withFile = true;
break;
} else if(str.equals("N")) {
withFile = false;
break;
} else {
System.out.println("Invalid command");
}
}
game = new Board(withFile);
while(!game.isFinish(withFile)) {
game.printBoard(withFile);
game.selectObject(withFile);
game.moveObject(withFile);
}
scan.close();
}
}