-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
35 lines (29 loc) · 1.09 KB
/
Copy pathMain.java
File metadata and controls
35 lines (29 loc) · 1.09 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
33
34
35
public class Main {
public static void main(String[] args) {
if (args.length > 0 && "--smoke-test".equalsIgnoreCase(args[0])) {
if (args.length > 1 && "snake".equalsIgnoreCase(args[1])) {
System.out.println(SnakeGameLauncher.runSmokeTest());
return;
}
if (args.length > 1 && isBlockfall(args[1])) {
System.out.println(TetrisGameLauncher.runSmokeTest());
return;
}
System.out.println(SnakeGameLauncher.runSmokeTest());
System.out.println(TetrisGameLauncher.runSmokeTest());
return;
}
if (args.length > 0 && "snake".equalsIgnoreCase(args[0])) {
SnakeGameLauncher.launch();
return;
}
if (args.length > 0 && isBlockfall(args[0])) {
TetrisGameLauncher.launch();
return;
}
TetrisGameLauncher.launch();
}
private static boolean isBlockfall(String value) {
return "tetris".equalsIgnoreCase(value) || "blockfall".equalsIgnoreCase(value);
}
}