-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathApplication.java
More file actions
32 lines (26 loc) · 1.02 KB
/
Application.java
File metadata and controls
32 lines (26 loc) · 1.02 KB
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
package chess;
import chess.view.InputView;
import chess.view.ResultView;
public class Application {
public static void main(String[] args) {
InputView inputView = new InputView();
ResultView resultView = new ResultView();
Board board = new Board();
resultView.printBoard(board);
while (true) {
String movement = inputView.readMovement();
if (movement.equals("exit")) {
break;
}
String[] tokens = movement.split(" ");
String[] tokens1 = tokens[0].split(",");
String[] tokens2 = tokens[1].split(",");
Position start = new Position(Row.of(tokens1[1]), Column.valueOf(tokens1[0]));
Position destination = new Position(Row.of(tokens2[1]), Column.valueOf(tokens2[0]));
System.out.println("start = " + start);
System.out.println("destination = " + destination);
board.move(start, destination);
resultView.printBoard(board);
}
}
}